Opened 10 years ago

Closed 10 years ago

#6803 closed (fixed)

Uniqueness of fields is not examined in ordering of generic relations on queryset-refactor

Reported by: jhenry <jhenry@…> Owned by: nobody
Component: Database layer (models, ORM) Version: queryset-refactor
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Attached is a use case and a to reproduce the problem.

Attachments (2)

generic_unique_ordering_case.txt (4.5 KB) - added by jhenry <jhenry@…> 10 years ago. (608 bytes) - added by jhenry <jhenry@…> 10 years ago.

Download all attachments as: .zip

Change History (4)

Changed 10 years ago by jhenry <jhenry@…>

Changed 10 years ago by jhenry <jhenry@…>

Attachment: added

comment:1 Changed 10 years ago by Jacob

Just a note from talking about this: the basic reason that this is happening is that Django doesn't "know" that Person.pony is actually a foreign key instead of a many-to-many. This is a limitation of GenericRelation; you can't specify the different between a single relation (Person.pony) and multiple ones (Story.comments).

comment:2 Changed 10 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

Fixed in [7285]. It turns out to be logically impossible to always know when this ordering is permissible (see the example in the commit message), so I've removed the safety net.

Note: See TracTickets for help on using tickets.
Back to Top