server/rqlannotation.py
branchstable
changeset 6940 1172c25655b7
parent 6297 23c1e50ff97b
child 7041 5a6fd60f7617
equal deleted inserted replaced
6939:8fa55cf2a8cb 6940:1172c25655b7
   193     principal = None
   193     principal = None
   194     # sort for test predictability
   194     # sort for test predictability
   195     for rel in sorted(relations, key=lambda x: (x.children[0].name, x.r_type)):
   195     for rel in sorted(relations, key=lambda x: (x.children[0].name, x.r_type)):
   196         # only equality relation with a variable as rhs may be principal
   196         # only equality relation with a variable as rhs may be principal
   197         if rel.operator() not in ('=', 'IS') \
   197         if rel.operator() not in ('=', 'IS') \
   198                or not isinstance(rel.children[1].children[0], VariableRef):
   198                or not isinstance(rel.children[1].children[0], VariableRef) or rel.neged(strict=True):
   199             continue
   199             continue
   200         if rel.scope is rel.stmt:
   200         if rel.scope is rel.stmt:
   201             return rel
   201             return rel
   202         principal = rel
   202         principal = rel
   203     if principal is None:
   203     if principal is None: