#25118: add template filter doesn't work with mixed types
--------------------------------------+------------------------------------
Reporter: dvinegla | Owner: kswiat
Type: Cleanup/optimization | Status: assigned
Component: Template system | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Comment (by kswiat):
https://docs.djangoproject.com/en/1.8/ref/templates/builtins/#add
{{{
This filter will first try to coerce both values to integers. If this
fails, it’ll attempt to add the values together anyway. This will work on
some data types (strings, list, etc.) and fail on others. If it fails, the
result will be an empty string.
}}}
References: #11687, #16676
The question is, how the `add` tag should behave. If adding fails, do we
expect the result to be concatenated string? Maybe we need separate tag to
do that?
--
Ticket URL: <https://code.djangoproject.com/ticket/25118#comment:3>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.d1d8cec804a0105df045b3157c62873c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.