#16647: Default filters: pacth to add  QuerySet support for random plus a new
shuffle filter
-------------------------+---------------------------------
 Reporter:  h3           |          Owner:  nobody
     Type:  New feature  |         Status:  new
Milestone:               |      Component:  Template system
  Version:  1.3          |       Severity:  Normal
 Keywords:               |   Triage Stage:  Unreviewed
Has patch:  1            |  Easy pickings:  0
    UI/UX:  0            |
-------------------------+---------------------------------
 I believe the way the random filter works right now is asinine or at least
 not very useful.

 When working in templates, 90% of the lists we have to deal with are
 QuerySet instances, so for this filter to choke when we pass it an object
 list is not very helpful.

 I've seen [https://code.djangoproject.com/ticket/8044 a proposed patch]
 for this posted three years ago, but it was rejected on the ground that it
 required a new db hit and thus was problematic for large querysets. Fair
 enough.

 My patch use the queryset.order_by('?') method so it (theoretically)
 doesn't require a new database hit.

 It also introduce a new "shuffle" filter, which useful when you want to
 randomize a list or a queryset instead of just picking one randomly.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16647>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to