Meta ordering on foreign key field which can be None
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)
| Keywords: |
qsrf-cleanup added
|
| Resolution: |
→ fixed
|
| Status: |
new → closed
|
I can confirm that this is also a problem for me (PostgreSQL, latest trunk). See:
my example