#13089: Support Negative Indexing on QuerySets
-------------------------------------+-------------------------------------
     Reporter:  adamnelson           |                    Owner:  nobody
         Type:  Uncategorized        |                   Status:  closed
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |               Resolution:  wontfix
     Severity:  Normal               |             Triage Stage:
     Keywords:  feature              |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by loic84):

 Replying to [comment:9 django@…]:
 > AFAIK, you can't negative index a generator without first exhausting the
 generator ... that would be a similar (but not identical) analogy to
 negative indexing a queryset (ie you have to retrieve the whole queryset
 before you can know the size).

 Negative indexing could be implemented without performance issues, just
 look at the implementation of `QuerySet.__getitem__()`.

 The fancy slicing operations like `[::2]` which don't translate well to
 SQL are the real problem, I don't think we need to support those.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/13089#comment:10>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.4f58474fc13a9a2034e4fa4e12442b44%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to