#5567: Last and nth template filters
-----------------------+----------------------------------------------------
Reporter:  ChrisH      |       Owner:  nobody         
  Status:  new         |   Component:  Template system
 Version:  SVN         |    Keywords:                 
   Stage:  Unreviewed  |   Has_patch:  1              
-----------------------+----------------------------------------------------
 Hi,

 It seemed like an oversight that there wasn't a "last" template filter
 similar to the "first" filter. I wrote it up, along with tests, and added
 in an nth filter that takes an arg and accessing that index of the value.

 >>> last([0, 1, 2, 3, 4])
 4
 >>> last(u'Hello')
 u'o'
 >>> nth(['a', 'b', 'c', 'd'], 1)
 'b'
 >>> nth(u'abcd', 1)
 u'b'

-- 
Ticket URL: <http://code.djangoproject.com/ticket/5567>
Django Code <http://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