set size of select widget tls-sprint
authorsylvain.thenault@logilab.fr
Wed, 29 Apr 2009 09:07:26 +0200
branchtls-sprint
changeset 1531 5fc1e6a15147
parent 1530 849fd3d64f11
child 1532 111c52e0022f
set size of select widget
web/views/management.py
--- a/web/views/management.py	Wed Apr 29 09:03:31 2009 +0200
+++ b/web/views/management.py	Wed Apr 29 09:07:26 2009 +0200
@@ -161,12 +161,14 @@
                                 domid='reqperm%s' % entity.eid,
                                 __redirectvid='security',
                                 __redirectpath=entity.rest_path())
-        form.form_add_hidden('require_permission', entity.eid, role='object', eidparam=True)
+        form.form_add_hidden('require_permission', entity.eid, role='object',
+                             eidparam=True)
         permnames = getattr(entity, '__permissions__', None)
         cwpermschema = newperm.e_schema
         if permnames is not None:
             field = guess_field(cwpermschema, self.schema.rschema('name'),
-                                widget=formwidgets.Select, choices=permnames)
+                                widget=formwidgets.Select({'size': 1}),
+                                choices=permnames)
         else:
             field = guess_field(cwpermschema, self.schema.rschema('name'))
         form.append_field(field)