--- a/server/repository.py Thu Oct 15 20:31:44 2009 +0200
+++ b/server/repository.py Thu Oct 15 20:31:55 2009 +0200
@@ -95,6 +95,7 @@
def commit_event(self):
pass
+
def del_existing_rel_if_needed(session, eidfrom, rtype, eidto):
"""delete existing relation when adding a new one if card is 1 or ?
@@ -110,6 +111,7 @@
return
ensure_card_respected(session.unsafe_execute, session, eidfrom, rtype, eidto)
+
def ensure_card_respected(execute, session, eidfrom, rtype, eidto):
card = rproperty(session, rtype, eidfrom, eidto, 'cardinality')
# one may be tented to check for neweids but this may cause more than one
@@ -127,6 +129,7 @@
execute('DELETE X %s Y WHERE NOT X eid %%(x)s, Y eid %%(y)s' % rtype,
{'x': eidfrom, 'y': eidto}, 'y')
+
class Repository(object):
"""a repository provides access to a set of persistent storages for
entities and relations
--- a/server/rqlannotation.py Thu Oct 15 20:31:44 2009 +0200
+++ b/server/rqlannotation.py Thu Oct 15 20:31:55 2009 +0200
@@ -234,7 +234,7 @@
syntax tree or because a solution for this variable has been removed
due to security filtering)
"""
- assert rqlst.TYPE == 'select', rqlst
+ #assert rqlst.TYPE == 'select', rqlst
rqlst.has_text_query = self._annotate_union(rqlst)
def _annotate_union(self, union):