Opened 17 years ago

Closed 17 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: no UI/UX: no

Description

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

Attachments (2)

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

Download all attachments as: .zip

Change History (4)

by jhenry <jhenry@…>, 17 years ago

by jhenry <jhenry@…>, 17 years ago

Attachment: models.py added

comment:1 by Jacob, 17 years ago

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 by Malcolm Tredinnick, 17 years ago

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