with cw 3.6 we've to specify entity's relation role
authorStephanie Marcu <stephanie.marcu@logilab.fr>
Tue, 19 Jan 2010 10:42:47 +0100
changeset 4258 16804a4f555d
parent 4257 0a9b38a492e1
child 4259 83b0bf9b0a51
with cw 3.6 we've to specify entity's relation role
web/views/cwproperties.py
--- a/web/views/cwproperties.py	Tue Jan 19 10:19:08 2010 +0100
+++ b/web/views/cwproperties.py	Tue Jan 19 10:42:47 2010 +0100
@@ -212,10 +212,10 @@
             label = key
         subform = self._cw.vreg['forms'].select('base', self._cw, entity=entity,
                                                 mainform=False)
-        subform.append_field(PropertyValueField(name='value', label=label,
+        subform.append_field(PropertyValueField(name='value', label=label, role='subject',
                                                 eidparam=True))
         #subform.vreg = self._cw.vreg
-        subform.add_hidden('pkey', key, eidparam=True)
+        subform.add_hidden('pkey', key, eidparam=True, role='subject')
         form.add_subform(subform)
         return subform
 
@@ -253,7 +253,7 @@
         # if user is in the managers group and the property is being created,
         # we have to set for_user explicitly
         if not subform.edited_entity.has_eid() and self.user.matching_groups('managers'):
-            subform.add_hidden('for_user', self.user.eid, eidparam=True)
+            subform.add_hidden('for_user', self.user.eid, eidparam=True, role='subject')
 
 
 # cwproperty form objects ######################################################