#7181 closed (fixed)
Meta ordering on foreign key field which can be None
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Keywords: | qsrf-cleanup | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
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().
Change History (5)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
Keywords: | qsrf-cleanup added |
---|
comment:3 by , 16 years ago
milestone: | → 1.0 |
---|
comment:4 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
I can confirm that this is also a problem for me (PostgreSQL, latest trunk). See:
my example