__init__.py
branchstable
changeset 3634 a2d00ff6eb68
parent 3601 d77025be6f06
child 3651 633b8971c95a
--- a/__init__.py	Fri Oct 09 19:20:38 2009 +0200
+++ b/__init__.py	Fri Oct 09 19:21:06 2009 +0200
@@ -133,11 +133,13 @@
         """
         rql = 'INSERT %s X' % etype
         relations = []
-        restrictions = []
+        restrictions = set()
         cachekey = []
         for rtype, rvar in args:
             relations.append('X %s %s' % (rtype, rvar))
-            restrictions.append('%s eid %%(%s)s' % (rvar, rvar))
+            restriction = '%s eid %%(%s)s' % (rvar, rvar)
+            if not restriction in restrictions:
+                restrictions.add(restriction)
             cachekey.append(rvar)
         for attr in kwargs:
             if attr in cachekey: