#23571: Empty order_by() doesn't work with slice
-------------------------------------+-------------------------------------
     Reporter:  liminspace           |                    Owner:
         Type:  Bug                  |  liminspace
    Component:  Database layer       |                   Status:  closed
  (models, ORM)                      |                  Version:  1.7
     Severity:  Normal               |               Resolution:
     Keywords:  order_by, slice      |  worksforme
    Has patch:  0                    |             Triage Stage:
  Needs tests:  0                    |  Unreviewed
Easy pickings:  0                    |      Needs documentation:  0
                                     |  Patch needs improvement:  0
                                     |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by timgraham):

 * status:  new => closed
 * resolution:   => worksforme


Comment:

 I also cannot reproduce the reported issue:

 I added:
 {{{
 class Meta:
     ordering = ('id',)
 }}}
 to the Poll class in the tutorial.

 {{{
 >>> str(Poll.objects.all().query)
 'SELECT "polls_poll"."id", "polls_poll"."question",
 "polls_poll"."pub_date" FROM "polls_poll" ORDER BY "polls_poll"."id" ASC'
 >>> str(Poll.objects.order_by().query)
 'SELECT "polls_poll"."id", "polls_poll"."question",
 "polls_poll"."pub_date" FROM "polls_poll"'
 >>> str(Poll.objects.order_by()[:10].query)
 'SELECT "polls_poll"."id", "polls_poll"."question",
 "polls_poll"."pub_date" FROM "polls_poll" LIMIT 10'
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23571#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.652744294c1a3cfed929b5b942fcd194%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to