spa2rql.py
changeset 10669 155c29e0ed1c
parent 10662 10942ed172de
equal deleted inserted replaced
10668:4fb62d791073 10669:155c29e0ed1c
   146 
   146 
   147     def finalize(self):
   147     def finalize(self):
   148         """return corresponding rql query (string) / args (dict)"""
   148         """return corresponding rql query (string) / args (dict)"""
   149         for varname, ptypes in self.possible_types.items():
   149         for varname, ptypes in self.possible_types.items():
   150             if len(ptypes) == 1:
   150             if len(ptypes) == 1:
   151                 self.restrictions.append('%s is %s' % (varname, iter(ptypes).next()))
   151                 self.restrictions.append('%s is %s' % (varname, next(iter(ptypes))))
   152         unions = []
   152         unions = []
   153         for releq, subjvar, obj in self.union_params:
   153         for releq, subjvar, obj in self.union_params:
   154             thisunions = []
   154             thisunions = []
   155             for st, rt, ot in releq:
   155             for st, rt, ot in releq:
   156                 thisunions.append([self.build_restriction(subjvar, rt, obj)])
   156                 thisunions.append([self.build_restriction(subjvar, rt, obj)])