Changes between Initial Version and Version 1 of Ticket #23774


Ignore:
Timestamp:
Nov 6, 2014, 12:21:04 PM (10 years ago)
Author:
David Wolever
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23774

    • Property Summary Documentation on ordering by ForeignKey fields is incorrectDocumentation on ordering by ForeignKey fields is misleading
  • Ticket #23774 – Description

    initial v1  
    99
    1010
    11 But this is incorrect.
     11But this is misleading, and should probably show ordering by the related model's ordering.
    1212
    1313
    14 When ordering by a `ForeignKey`, the related model's default ordering will be used. For example, consider:
     14A quick example that might be more instructive::
    1515
    1616{{{
     
    3333INNER JOIN "django_testproj_widgettype" ON ( "django_testproj_widget"."type_id" = "django_testproj_widgettype"."id" )
    3434ORDER BY "django_testproj_widgettype"."label" ASC
    35 >>> django.VERSION
    36 (1, 7, 1, 'final', 0)
    3735}}}
    3836
     37
     38**Edit** I can't read and totally missed the "or order by the related model’s primary key if there is no Meta.ordering specified" each time I read the documentation. I'll leave the ticket standing as I'm probably not the only one to hit this?
Back to Top