web/formfields.py
changeset 9205 ea32e964fbf8
parent 9147 01124cfd4b1f
parent 9179 570208f74a84
child 9217 b4ac21bf6019
--- a/web/formfields.py	Thu Jul 04 09:26:59 2013 +0200
+++ b/web/formfields.py	Tue Jul 30 20:31:57 2013 +0200
@@ -1,4 +1,4 @@
-# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 #
 # This file is part of CubicWeb.
@@ -1153,12 +1153,19 @@
         elif not isinstance(values, list):
             values = (values,)
         eids = set()
+        rschema = form._cw.vreg.schema.rschema(self.name)
         for eid in values:
             if not eid or eid == INTERNAL_FIELD_VALUE:
                 continue
             typed_eid = form.actual_eid(eid)
+            # if entity doesn't exist yet
             if typed_eid is None:
-                form._cw.data['pendingfields'].add( (form, self) )
+                # inlined relations of to-be-created **subject entities** have
+                # to be handled separatly
+                if self.role == 'object' and rschema.inlined:
+                    form._cw.data['pending_inlined'][eid].add( (form, self) )
+                else:
+                    form._cw.data['pending_others'].add( (form, self) )
                 return None
             eids.add(typed_eid)
         return eids