DIV(...,data=dict(action='whatever')
This commit is contained in:
@@ -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
@@ -887,9 +887,8 @@ class DIV(XmlComponent):
|
|||||||
|
|
||||||
# get the attributes for this component
|
# get the attributes for this component
|
||||||
# (they start with '_', others may have special meanings)
|
# (they start with '_', others may have special meanings)
|
||||||
fa = ''
|
attr = []
|
||||||
for key in sorted(self.attributes):
|
for key, value in self.attributes.iteritems():
|
||||||
value = self[key]
|
|
||||||
if key[:1] != '_':
|
if key[:1] != '_':
|
||||||
continue
|
continue
|
||||||
name = key[1:]
|
name = key[1:]
|
||||||
@@ -897,8 +896,16 @@ class DIV(XmlComponent):
|
|||||||
value = name
|
value = name
|
||||||
elif value is False or value is None:
|
elif value is False or value is None:
|
||||||
continue
|
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))
|
fa += ' %s="%s"' % (name, xmlescape(value, True))
|
||||||
|
|
||||||
# get the xml for the inner components
|
# get the xml for the inner components
|
||||||
co = join([xmlescape(component) for component in
|
co = join([xmlescape(component) for component in
|
||||||
self.components])
|
self.components])
|
||||||
|
|||||||
Reference in New Issue
Block a user