shouldn't use unicode keys in attrs tls-sprint
authorsylvain.thenault@logilab.fr
Tue, 14 Apr 2009 18:03:28 +0200
branchtls-sprint
changeset 1344 930020cb134b
parent 1343 659d3dc42e68
child 1345 9f086baa2537
shouldn't use unicode keys in attrs
web/formwidgets.py
--- a/web/formwidgets.py	Tue Apr 14 18:03:11 2009 +0200
+++ b/web/formwidgets.py	Tue Apr 14 18:03:28 2009 +0200
@@ -269,11 +269,11 @@
 
 def init_ajax_attributes(attrs, wdgtype, loadtype=u'auto'):
     try:
-        attrs[u'klass'] += u' widget'
+        attrs['klass'] += u' widget'
     except KeyError:
-        attrs[u'klass'] = u'widget'
-    attrs.setdefault(u'cubicweb:wdgtype', wdgtype)
-    attrs.setdefault(u'cubicweb:loadtype', loadtype)
+        attrs['klass'] = u'widget'
+    attrs.setdefault('cubicweb:wdgtype', wdgtype)
+    attrs.setdefault('cubicweb:loadtype', loadtype)
 
 
 class AjaxWidget(FieldWidget):
@@ -282,7 +282,7 @@
         super(AjaxWidget, self).__init__(**kwargs)
         init_ajax_attributes(self.attrs, wdgtype)
         if inputid is not None:
-            self.attrs[u'cubicweb:inputid'] = inputid
+            self.attrs['cubicweb:inputid'] = inputid
             
     def render(self, form, field):
         self.add_media(form)