Changes between Initial Version and Version 6 of Ticket #26211


Ignore:
Timestamp:
Feb 12, 2016, 9:33:12 AM (9 years ago)
Author:
Alex Rothberg
Comment:

@charettes I actually think that the example you provided indicates what I would consider a deficiency of the ORM: coalescing multiple calls to order_by with the same argument (I have modified the original queryset in your example):

>>> children = Child.objects.order_by('saved_dt').all()
>>> list(children)
[<Child: Child object>, <Child: Child object>]
(0.001) SELECT "prefetch_child"."id", "prefetch_child"."saved_dt", "prefetch_child"."parent_id" FROM "prefetch_child" ORDER BY "prefetch_child"."saved_dt" ASC; args=()
>>> list(children)
[<Child: Child object>, <Child: Child object>]
>>> children.order_by('saved_dt') 
[<Child: Child object>, <Child: Child object>]
(0.000) SELECT "prefetch_child"."id", "prefetch_child"."saved_dt", "prefetch_child"."parent_id" FROM "prefetch_child" ORDER BY "prefetch_child"."saved_dt" ASC LIMIT 21; args=()

I would hope that the second call to children.order_by('saved_dt') can return self since the queryset is already sorted by the desired key.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #26211

    • Property Component UncategorizedDatabase layer (models, ORM)
    • Property Type UncategorizedNew feature
    • Property Resolutionwontfix
    • Property Status newclosed
  • Ticket #26211 – Description

    initial v6  
    2626}}}
    2727
    28 
     28I would hope that the second call to `children.order_by('saved_dt')` can return self since the queryset is already sorted by the desired key.
Back to Top