schema.py
branchstable
changeset 3967 dfb4b3797113
parent 3965 94f95928f5ae
child 3968 e8dbad65a7a2
equal deleted inserted replaced
3966:f742c525b7b4 3967:dfb4b3797113
   631         if eidto is None:
   631         if eidto is None:
   632             # checking constraint for an attribute relation
   632             # checking constraint for an attribute relation
   633             restriction = 'S eid %(s)s, ' + self.restriction
   633             restriction = 'S eid %(s)s, ' + self.restriction
   634             args, ck = {'s': eidfrom}, 's'
   634             args, ck = {'s': eidfrom}, 's'
   635         else:
   635         else:
   636             restriction =rql = 'S eid %(s)s, O eid %(o)s, ' + self.restriction
   636             restriction = 'S eid %(s)s, O eid %(o)s, ' + self.restriction
   637             args, ck = {'s': eidfrom, 'o': eidto}, ('s', 'o')
   637             args, ck = {'s': eidfrom, 'o': eidto}, ('s', 'o')
   638         rql = 'Any %s WHERE %s' % (self.mainvars,  restriction)
   638         rql = 'Any %s WHERE %s' % (self.mainvars,  restriction)
   639         if self.distinct_query:
   639         if self.distinct_query:
   640             rql = 'DISTINCT ' + rql
   640             rql = 'DISTINCT ' + rql
   641         return session.unsafe_execute(rql, args, ck, build_descr=False)
   641         return session.unsafe_execute(rql, args, ck, build_descr=False)