entity.py
branchstable
changeset 3826 0c0c051863cb
parent 3746 74192424b2c8
child 3877 7ca53fc72a0a
child 3919 f91bd15f427c
--- a/entity.py	Thu Nov 12 12:08:43 2009 +0100
+++ b/entity.py	Thu Nov 12 12:15:19 2009 +0100
@@ -778,9 +778,13 @@
             rqlexprs = rtype.get_rqlexprs('add')
             rewriter = RQLRewriter(self.req)
             rqlst = self.req.vreg.parse(self.req, rql, args)
+            if not self.has_eid():
+                existant = searchedvar
+            else:
+                existant = None # instead of 'SO', improve perfs
             for select in rqlst.children:
                 rewriter.rewrite(select, [((searchedvar, searchedvar), rqlexprs)],
-                                 select.solutions, args)
+                                 select.solutions, args, existant)
             rql = rqlst.as_string()
         return rql, args