Created
May 17, 2011 13:30
-
-
Save jedie/976467 to your computer and use it in GitHub Desktop.
django/forms/util.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/django/forms/util.py b/django/forms/util.py | |
index 1a1d823..8a48009 100644 | |
--- a/django/forms/util.py | |
+++ b/django/forms/util.py | |
@@ -13,7 +13,7 @@ def flatatt(attrs): | |
XML-style pairs. It is assumed that the keys do not need to be XML-escaped. | |
If the passed dictionary is empty, then return an empty string. | |
""" | |
- return u''.join([u' %s="%s"' % (k, conditional_escape(v)) for k, v in attrs.items()]) | |
+ return u''.join([u' %s="%s"' % (k, conditional_escape(v)) for k, v in sorted(attrs.items())]) | |
class ErrorDict(dict, StrAndUnicode): | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment