DIV(...,data=dict(action='whatever')

This commit is contained in:
mdipierro
2013-03-10 11:27:13 -05:00
parent 22accaced3
commit a5284e846c
2 changed files with 12 additions and 5 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.4.2-stable+timestamp.2013.03.10.11.13.44
Version 2.4.2-stable+timestamp.2013.03.10.11.26.20
+11 -4
View File
@@ -887,9 +887,8 @@ class DIV(XmlComponent):
# get the attributes for this component
# (they start with '_', others may have special meanings)
fa = ''
for key in sorted(self.attributes):
value = self[key]
attr = []
for key, value in self.attributes.iteritems():
if key[:1] != '_':
continue
name = key[1:]
@@ -897,8 +896,16 @@ class DIV(XmlComponent):
value = name
elif value is False or value is None:
continue
attr.append((name, value))
data = self.attributes.get('data',{})
for key, value in data.iteritems():
name = 'data-' + key
value = data[key]
attr.append((name,value))
attr.sort()
fa = ''
for name,value in attr:
fa += ' %s="%s"' % (name, xmlescape(value, True))
# get the xml for the inner components
co = join([xmlescape(component) for component in
self.components])