--- a/schema.py Thu Oct 03 15:37:45 2013 +0200
+++ b/schema.py Tue Oct 08 16:10:42 2013 +0200
@@ -702,6 +702,8 @@
'expression %s', mainvar, self)
# syntax tree used by read security (inserted in queries when necessary)
self.snippet_rqlst = parse(self.minimal_rql, print_errors=False).children[0]
+ # graph of links between variables, used by rql rewriter
+ self.vargraph = vargraph(self.rqlst)
def __str__(self):
return self.full_rql
@@ -909,8 +911,6 @@
if mainvars is None:
mainvars = guess_rrqlexpr_mainvars(expression)
RQLExpression.__init__(self, expression, mainvars, eid)
- # graph of links between variable, used by rql rewriter
- self.vargraph = vargraph(self.rqlst)
@property
def full_rql(self):
--- a/test/unittest_rqlrewrite.py Thu Oct 03 15:37:45 2013 +0200
+++ b/test/unittest_rqlrewrite.py Tue Oct 08 16:10:42 2013 +0200
@@ -438,30 +438,30 @@
u"Any C WHERE C is Card, EXISTS(C owned_by A, A is CWUser)")
def test_rqlexpr_not_relation_1_1(self):
- constraint = RRQLExpression('X owned_by Z, Z login "hop"', 'X')
+ constraint = ERQLExpression('X owned_by Z, Z login "hop"', 'X')
rqlst = parse('Affaire A WHERE NOT EXISTS(A documented_by C)')
rewrite(rqlst, {('C', 'X'): (constraint,)}, {}, 'X')
self.assertEqual(rqlst.as_string(),
u'Any A WHERE NOT EXISTS(A documented_by C, EXISTS(C owned_by B, B login "hop", B is CWUser), C is Card), A is Affaire')
def test_rqlexpr_not_relation_1_2(self):
- constraint = RRQLExpression('X owned_by Z, Z login "hop"', 'X')
+ constraint = ERQLExpression('X owned_by Z, Z login "hop"', 'X')
rqlst = parse('Affaire A WHERE NOT EXISTS(A documented_by C)')
rewrite(rqlst, {('A', 'X'): (constraint,)}, {}, 'X')
self.assertEqual(rqlst.as_string(),
u'Any A WHERE NOT EXISTS(A documented_by C, C is Card), A is Affaire, EXISTS(A owned_by B, B login "hop", B is CWUser)')
def test_rqlexpr_not_relation_2(self):
- constraint = RRQLExpression('X owned_by Z, Z login "hop"', 'X')
+ constraint = ERQLExpression('X owned_by Z, Z login "hop"', 'X')
rqlst = rqlhelper.parse('Affaire A WHERE NOT A documented_by C', annotate=False)
rewrite(rqlst, {('C', 'X'): (constraint,)}, {}, 'X')
self.assertEqual(rqlst.as_string(),
u'Any A WHERE NOT EXISTS(A documented_by C, EXISTS(C owned_by B, B login "hop", B is CWUser), C is Card), A is Affaire')
def test_rqlexpr_multiexpr_outerjoin(self):
- c1 = RRQLExpression('X owned_by Z, Z login "hop"', 'X')
- c2 = RRQLExpression('X owned_by Z, Z login "hip"', 'X')
- c3 = RRQLExpression('X owned_by Z, Z login "momo"', 'X')
+ c1 = ERQLExpression('X owned_by Z, Z login "hop"', 'X')
+ c2 = ERQLExpression('X owned_by Z, Z login "hip"', 'X')
+ c3 = ERQLExpression('X owned_by Z, Z login "momo"', 'X')
rqlst = rqlhelper.parse('Any A WHERE A documented_by C?', annotate=False)
rewrite(rqlst, {('C', 'X'): (c1, c2, c3)}, {}, 'X')
self.assertEqual(rqlst.as_string(),