-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
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.
davidmarble
Metadata
Metadata
Assignees
Labels
No labels