diff options
author | Robin Munn <robin.munn@gmail.com> | 2007-01-31 23:43:09 +0000 |
---|---|---|
committer | Robin Munn <robin.munn@gmail.com> | 2007-01-31 23:43:09 +0000 |
commit | fe361e678a46dc4c717c79c2f12b3ba32293b81a (patch) | |
tree | 8f42488e7d95244bab3db7b2bf934e006940521a /django/newforms/util.py | |
parent | 122426e7453ed638a0c5be7e8b925adcddea3889 (diff) | |
download | django-fe361e678a46dc4c717c79c2f12b3ba32293b81a.tar.gz |
Merged revisions 4186 to 4454 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/sqlalchemy@4455 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/newforms/util.py')
-rw-r--r-- | django/newforms/util.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/django/newforms/util.py b/django/newforms/util.py index a78623a17b..2fec9e4e2e 100644 --- a/django/newforms/util.py +++ b/django/newforms/util.py @@ -1,4 +1,9 @@ from django.conf import settings +from django.utils.html import escape + +# 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()]) def smart_unicode(s): if not isinstance(s, basestring): |