[user form] use InOutWidget to edit CWUser in_group relation stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 26 Jan 2011 09:32:34 +0100
branchstable
changeset 6891 e409a012c505
parent 6890 1b2fcb9356a3
child 6892 e73245c14516
[user form] use InOutWidget to edit CWUser in_group relation
web/views/cwuser.py
--- a/web/views/cwuser.py	Tue Jan 25 12:50:56 2011 +0100
+++ b/web/views/cwuser.py	Wed Jan 26 09:32:34 2011 +0100
@@ -26,7 +26,7 @@
 
 from cubicweb.selectors import one_line_rset, is_instance, match_user_groups
 from cubicweb.view import EntityView
-from cubicweb.web import action, uicfg
+from cubicweb.web import action, uicfg, formwidgets
 from cubicweb.web.views import tabs
 
 _pvs = uicfg.primaryview_section
@@ -39,6 +39,11 @@
 _pvs.tag_object_of(('*', 'in_group', 'CWGroup'), 'relations')
 _pvs.tag_object_of(('*', 'require_group', 'CWGroup'), 'relations')
 
+_affk = uicfg.autoform_field_kwargs
+
+_affk.tag_subject_of(('CWUser', 'in_group', 'CWGroup'),
+                    {'widget': formwidgets.InOutWidget})
+
 class UserPreferencesEntityAction(action.Action):
     __regid__ = 'prefs'
     __select__ = (one_line_rset() & is_instance('CWUser') &