ensure str is given as field's name stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 30 Sep 2009 17:56:53 +0200
branchstable
changeset 3534 81cfec545e1b
parent 3533 88ceed15a3d3
child 3535 106b95ec1144
ensure str is given as field's name
web/views/editforms.py
--- a/web/views/editforms.py	Wed Sep 30 17:32:29 2009 +0200
+++ b/web/views/editforms.py	Wed Sep 30 17:56:53 2009 +0200
@@ -504,9 +504,10 @@
     def add_hiddens(self, form, entity):
         """to ease overriding (see cubes.vcsfile.views.forms for instance)"""
         iid = 'rel-%s-%s-%s' % (self.peid, self.rtype, entity.eid)
-        form.form_add_hidden(name=self.rtype, value=self.peid,
-                             # role is the for parent entity, we want the role
-                             # of the inlined entity
+        #  * str(self.rtype) in case it's a schema object 
+        #  * neged_role() since role is the for parent entity, we want the role
+        #    of the inlined entity
+        form.form_add_hidden(name=str(self.rtype), value=self.peid,
                              role=neg_role(self.role), eidparam=True, id=iid)
 
     def keep_entity(self, form, entity):