#25067: Allowing all characters when parsing inclusion templatetags
-------------------------+-------------------------------------------------
Reporter: srkunze | Owner: nobody
Type: Bug | Status: new
Component: | Version: master
Template system | Keywords: inclusion_tag, parse_bits,
Severity: Normal | token_kwargs
Triage Stage: | Has patch: 0
Unreviewed |
Easy pickings: 1 | UI/UX: 0
-------------------------+-------------------------------------------------
We use the inclusion_tag to create a special HTML DIV element with several
custom attributes; basically like this:
{{{
@inclusion_tag('...')
def my_tag(x, **kwargs):
return {
'y': x +1,
'extra_attrs': kwargs,
}
}}}
Unfortunately, django/template/base.py:token_kwargs does not recognize '-'
in variable names so that extra HTML attrs such as 'data-myattr' cannot be
added to the DIV.
Python as such supports special characters in **kwargs.
--
Ticket URL: <https://code.djangoproject.com/ticket/25067>
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/050.d7109489876bc6188b7109223c1bb758%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.