server/rqlannotation.py
branch3.5
changeset 3249 280080eadb22
parent 2353 b11f1068a0d3
child 3689 deb13e88e037
equal deleted inserted replaced
3248:db09803df8b2 3249:280080eadb22
   329 
   329 
   330     def set_rel_constraint(self, term, rel, etypes_func):
   330     def set_rel_constraint(self, term, rel, etypes_func):
   331         if isinstance(term, VariableRef) and self.is_ambiguous(term.variable):
   331         if isinstance(term, VariableRef) and self.is_ambiguous(term.variable):
   332             var = term.variable
   332             var = term.variable
   333             if len(var.stinfo['relations'] - var.stinfo['typerels']) == 1 \
   333             if len(var.stinfo['relations'] - var.stinfo['typerels']) == 1 \
   334                    or rel.sqlscope is var.sqlscope:
   334                    or rel.sqlscope is var.sqlscope or rel.r_type == 'identity':
   335                 self.restrict(var, frozenset(etypes_func()))
   335                 self.restrict(var, frozenset(etypes_func()))
   336                 try:
   336                 try:
   337                     self.maydeambrels[var].add(rel)
   337                     self.maydeambrels[var].add(rel)
   338                 except KeyError:
   338                 except KeyError:
   339                     self.maydeambrels[var] = set((rel,))
   339                     self.maydeambrels[var] = set((rel,))