cubicweb/server/repository.py
changeset 12051 bff3be6eebed
parent 12044 70bb46dfa87b
child 12054 d830ea048c97
equal deleted inserted replaced
12050:1c7be7b62823 12051:bff3be6eebed
   682             return self._type_cache[eid]
   682             return self._type_cache[eid]
   683         except KeyError:
   683         except KeyError:
   684             etype = self.system_source.eid_type(cnx, eid)
   684             etype = self.system_source.eid_type(cnx, eid)
   685             self._type_cache[eid] = etype
   685             self._type_cache[eid] = etype
   686             return etype
   686             return etype
   687 
       
   688     def querier_cache_key(self, cnx, rql, args, eidkeys):
       
   689         cachekey = [rql]
       
   690         for key in sorted(eidkeys):
       
   691             try:
       
   692                 etype = self.type_from_eid(args[key], cnx)
       
   693             except KeyError:
       
   694                 raise QueryError('bad cache key %s (no value)' % key)
       
   695             except TypeError:
       
   696                 raise QueryError('bad cache key %s (value: %r)' % (
       
   697                     key, args[key]))
       
   698             cachekey.append(etype)
       
   699             # ensure eid is correctly typed in args
       
   700             args[key] = int(args[key])
       
   701         return tuple(cachekey)
       
   702 
   687 
   703     def add_info(self, cnx, entity, source):
   688     def add_info(self, cnx, entity, source):
   704         """add type and source info for an eid into the system table,
   689         """add type and source info for an eid into the system table,
   705         and index the entity with the full text index
   690         and index the entity with the full text index
   706         """
   691         """