cubicweb/cwvreg.py
changeset 12882 3ddd03309315
parent 12785 a9025212ce0c
equal deleted inserted replaced
12881:38fcf5707295 12882:3ddd03309315
   548     @cached
   548     @cached
   549     def rqlhelper(self):
   549     def rqlhelper(self):
   550         return RQLHelper(self.schema,
   550         return RQLHelper(self.schema,
   551                          special_relations={'eid': 'uid', 'has_text': 'fti'})
   551                          special_relations={'eid': 'uid', 'has_text': 'fti'})
   552 
   552 
   553     def solutions(self, req, rqlst, args):
   553     def compute_var_types(self, req, rqlst, args):
   554         def type_from_eid(eid, req=req):
   554         def type_from_eid(eid, req=req):
   555             return req.entity_type(eid)
   555             return req.entity_type(eid)
   556         return self.rqlhelper.compute_solutions(rqlst, {'eid': type_from_eid}, args)
   556         return self.rqlhelper.compute_solutions(rqlst, {'eid': type_from_eid}, args)
   557 
   557 
   558     def parse(self, req, rql, args=None):
   558     def parse(self, req, rql, args=None):
   559         rqlst = self.rqlhelper.parse(rql)
   559         rqlst = self.rqlhelper.parse(rql)
   560         try:
   560         try:
   561             self.solutions(req, rqlst, args)
   561             self.compute_var_types(req, rqlst, args)
   562         except UnknownEid:
   562         except UnknownEid:
   563             for select in rqlst.children:
   563             for select in rqlst.children:
   564                 select.solutions = []
   564                 select.solutions = []
   565         return rqlst
   565         return rqlst
   566 
   566