1
0
mirror of https://github.com/django/django.git synced 2025-10-30 00:56:09 +00:00

newforms: Moved flatatt function from widgets.py to util.py

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4370 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty
2007-01-20 20:33:23 +00:00
parent a154d94e45
commit 93eebd95cb
3 changed files with 8 additions and 7 deletions

View File

@@ -8,7 +8,7 @@ __all__ = (
'Select', 'SelectMultiple', 'RadioSelect', 'CheckboxSelectMultiple',
)
from util import StrAndUnicode, smart_unicode
from util import flatatt, StrAndUnicode, smart_unicode
from django.utils.datastructures import MultiValueDict
from django.utils.html import escape
from itertools import chain
@@ -18,10 +18,6 @@ try:
except NameError:
from sets import Set as set # Python 2.3 fallback
# Converts a dictionary to a single string with key="value", XML-style with
# a leading space. Assumes keys do not need to be XML-escaped.
flatatt = lambda attrs: u''.join([u' %s="%s"' % (k, escape(v)) for k, v in attrs.items()])
class Widget(object):
is_hidden = False # Determines whether this corresponds to an <input type="hidden">.