Django

Code

Ticket #7181 (new)

Opened 5 days ago

Meta ordering on foreign key field which can be None

Reported by: kkulewski@student.uw.edu.pl Assigned to: nobody
Component: Database wrapper Version: SVN
Keywords: Cc:
Triage Stage: Unreviewed Has patch: 0
Needs documentation: Needs tests:
Patch needs improvement:

Description

I have model A which links to model B (using field b, but A.b can be None). In Meta of A I have ordering set to b.

AFAIK simple A.objects.all() select query contains INNER JOIN (in this case I use sqlite, but probably this problem is more popular) with relation B so if for some instance of A, A.b is None then it will be not included in the results of A.objects.all().

Attachments


Add/Change #7181 (Meta ordering on foreign key field which can be None)




Change Properties
Action