Ticket #2076: order.diff

File order.diff, 859 bytes (added by Michael Radziej <mir@…>, 12 years ago)
  • tests/modeltests/ordering/models.py

    diff --git a/tests/modeltests/ordering/models.py b/tests/modeltests/ordering/models.py
    index 6b2ae11..407b979 100644
    a b # but right now is ordering by the Reade 
    139139[<EditorResponse: Editor A, Reader D, Article 1>, <EditorResponse: Editor B, Reader D, Article 2>, <EditorResponse: Editor B, Reader C, Article 4>]
    140140
    141141# Order by another field of the related ReaderLetter object.
    142 >>> EditorResponse.objects.order_by('reader_letter__reader_name')
     142>>> EditorResponse.objects.order_by('reader_letter__reader_name', 'reader_letter__article')
    143143[<EditorResponse: Editor B, Reader C, Article 4>, <EditorResponse: Editor A, Reader D, Article 1>, <EditorResponse: Editor B, Reader D, Article 2>]
    144144
    145145# The ordering specification can span models through relationships too.
Back to Top