Opened 10 years ago
Last modified 10 years ago
#25067 closed Bug
Allowing all characters when parsing inclusion templatetags — at Initial Version
Description ¶
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.
Note:
See TracTickets
for help on using tickets.