#11687: The 'add' template filter only works for integers, and can fail noisily
---------------------------------------------+------------------------------
Reporter: thepointer | Owner: gruszczy
Status: new | Milestone: 1.2
Component: Template system | Version: 1.1
Resolution: | Keywords:
Stage: Design decision needed | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------+------------------------------
Comment (by SmileyChris):
The user should lose this information because a filter should '''never'''
raise an exception.
Read the first paragraphs here: http://docs.djangoproject.com/en/dev/howto
/custom-template-tags/#writing-custom-template-filters
I understand ducktyping.
A filter doesn't only accept strings as an argument, it could be any
object type. If they can't be added together, then it should just fail
silently - that's the template author's problem. This is not javascript,
so no automatic casting.
--
Ticket URL: <http://code.djangoproject.com/ticket/11687#comment:12>
Django <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
-~----------~----~----~----~------~----~------~--~---