cwvreg.py
branchstable
changeset 7302 c281afe35b8b
parent 7206 2723c52a0795
child 7304 66fa1b7ac784
child 7465 bb0c89d1a078
equal deleted inserted replaced
7298:a448e470c150 7302:c281afe35b8b
   370         # repositories (eg shingouz)
   370         # repositories (eg shingouz)
   371         cls = dump_class(cls, etype)
   371         cls = dump_class(cls, etype)
   372         cls.__regid__ = etype
   372         cls.__regid__ = etype
   373         cls.__initialize__(self.schema)
   373         cls.__initialize__(self.schema)
   374         return cls
   374         return cls
       
   375 
       
   376     def fetch_attrs(self, targettypes):
       
   377         """return intersection of fetch_attrs of each entity type in
       
   378         `targettypes`
       
   379         """
       
   380         fetchattrs_list = []
       
   381         for ttype in targettypes:
       
   382             etypecls = self.etype_class(ttype)
       
   383             fetchattrs_list.append(set(etypecls.fetch_attrs))
       
   384         return reduce(set.intersection, fetchattrs_list)
   375 
   385 
   376 VRegistry.REGISTRY_FACTORY['etypes'] = ETypeRegistry
   386 VRegistry.REGISTRY_FACTORY['etypes'] = ETypeRegistry
   377 
   387 
   378 
   388 
   379 class ViewsRegistry(CWRegistry):
   389 class ViewsRegistry(CWRegistry):