mirror of
https://github.com/django/django.git
synced 2025-08-20 10:40:32 +00:00
Fixed #8566 -- Allow safe-strings in the "attrs" parameter to form widgets.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8601 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
5f396193fb
commit
1fc8f84f58
3 changed files with 8 additions and 2 deletions
|
@ -50,6 +50,11 @@ u'<input type="text" class="fun" value="foo@example.com" name="email" />'
|
|||
>>> w.render('email', '', attrs={'class': 'special'})
|
||||
u'<input type="text" class="special" name="email" />'
|
||||
|
||||
'attrs' can be safe-strings if needed
|
||||
>>> w = TextInput(attrs={'onBlur': mark_safe("function('foo')")})
|
||||
>>> print w.render('email', '')
|
||||
<input onBlur="function('foo')" type="text" name="email" />
|
||||
|
||||
# PasswordInput Widget ############################################################
|
||||
|
||||
>>> w = PasswordInput()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue