diff --git a/VERSION b/VERSION index 7513e8ab..b0c77ce4 100644 --- a/VERSION +++ b/VERSION @@ -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 diff --git a/gluon/html.py b/gluon/html.py index f59dadb6..265e11d3 100644 --- a/gluon/html.py +++ b/gluon/html.py @@ -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])