Opened 8 years ago

Closed 8 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@…> 8 years ago. (608 bytes) - added by jhenry <jhenry@…> 8 years ago.

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by jhenry <jhenry@…>

Changed 8 years ago by jhenry <jhenry@…>

comment:1 Changed 8 years ago by jacob

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 8 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

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