[html form] use __linkto url parameter value as a default value of the corresponding field in a creation form (closes #2407770)
authorFlorent Cayré <florent.cayre@logilab.fr>
Mon, 09 Jul 2012 12:24:05 +0200
changeset 8458 1c5f3c66ec53
parent 8457 69ad9a509bc3
child 8459 1931953226f2
[html form] use __linkto url parameter value as a default value of the corresponding field in a creation form (closes #2407770)
web/formfields.py
--- a/web/formfields.py	Mon Jul 09 12:22:43 2012 +0200
+++ b/web/formfields.py	Mon Jul 09 12:24:05 2012 +0200
@@ -360,7 +360,7 @@
         if self.eidparam and self.role is not None:
             if form._cw.vreg.schema.rschema(self.name).final:
                 return form.edited_entity.e_schema.default(self.name)
-            return ()
+            return form.linked_to.get((self.name, self.role), ())
         return None
 
     def example_format(self, req):