You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The raw query generated by the Node are incompatible with Django Polymorphic because the .get_pk_name() method return the field name (e.g. parent_ptr) and not the field attribute name (e.g. parent_ptr_id).
Changing:
def get_pk_name(self):
"""Sometimes we set a field other than 'pk' for the primary key.
This method is used to get the correct primary key field name for the
model so that raw queries return the correct information."""
return self._meta.pk.name
to:
def get_pk_name(self):
"""Sometimes we set a field other than 'pk' for the primary key.
This method is used to get the correct primary key field name for the
model so that raw queries return the correct information."""
return self._meta.pk.attname
solve the problem.
The repo seems to not be up to date with the PyPi repo so I am hesitant to make a pull request.
The text was updated successfully, but these errors were encountered:
The raw query generated by the Node are incompatible with Django Polymorphic because the
.get_pk_name()
method return the field name (e.g.parent_ptr
) and not the field attribute name (e.g.parent_ptr_id
).Changing:
to:
solve the problem.
The repo seems to not be up to date with the PyPi repo so I am hesitant to make a pull request.
The text was updated successfully, but these errors were encountered: