Code

Opened 6 years ago

Closed 6 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:

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

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by jhenry <jhenry@…>

Changed 6 years ago by jhenry <jhenry@…>

comment:1 Changed 6 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 6 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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.