From fe361e678a46dc4c717c79c2f12b3ba32293b81a Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Wed, 31 Jan 2007 23:43:09 +0000 Subject: Merged revisions 4186 to 4454 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/sqlalchemy@4455 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/newforms/util.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'django/newforms/util.py') 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): -- cgit v1.2.1