Opened 18 years ago
Closed 18 years ago
#6803 closed (fixed)
Uniqueness of fields is not examined in ordering of generic relations on queryset-refactor
| Reported by: | 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)
Change History (4)
by , 18 years ago
| Attachment: | generic_unique_ordering_case.txt added |
|---|
by , 18 years ago
comment:1 by , 18 years ago
comment:2 by , 18 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → 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.
Just a note from talking about this: the basic reason that this is happening is that Django doesn't "know" that
Person.ponyis actually a foreign key instead of a many-to-many. This is a limitation ofGenericRelation; you can't specify the different between a single relation (Person.pony) and multiple ones (Story.comments).