Author: jezdez Date: 2011-07-25 02:19:47 -0700 (Mon, 25 Jul 2011) New Revision: 16550
Modified: django/trunk/django/template/defaultfilters.py Log: Fixed #16510 -- Actually added new truncatechars filter to the builtins and fixed a typo. Thanks, timdumol. Modified: django/trunk/django/template/defaultfilters.py =================================================================== --- django/trunk/django/template/defaultfilters.py 2011-07-19 17:19:32 UTC (rev 16549) +++ django/trunk/django/template/defaultfilters.py 2011-07-25 09:19:47 UTC (rev 16550) @@ -254,7 +254,7 @@ length = int(arg) except ValueError: # Invalid literal for int(). return value # Fail silently. - return Truncator(value).chars(value, length) + return Truncator(value).chars(length) truncatechars.is_safe = True truncatechars = stringfilter(truncatechars) @@ -922,6 +922,7 @@ register.filter(striptags) register.filter(time) register.filter(title) +register.filter(truncatechars) register.filter(truncatewords) register.filter(truncatewords_html) register.filter(unordered_list) -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.