Ejemplo n.º 1
0
 def _db_attrs(self):
     # Note: I "duplicate" the code from iterattrs and reimplement it
     # here, rather than
     # calling iterattrs from here, because iterattrs is slow on each call
     # since it has to call .getvalue(). To improve!
     from aiida.backends.djsite.db.models import DbAttribute
     attrlist = DbAttribute.list_all_node_elements(self.dbnode)
     for attr in attrlist:
         yield attr.key
Ejemplo n.º 2
0
 def attrs(self):
     from aiida.backends.djsite.db.models import DbAttribute
     # Note: I "duplicate" the code from iterattrs, rather than
     # calling iterattrs from here, because iterattrs is slow on each call
     # since it has to call .getvalue(). To improve!
     if self._to_be_stored:
         for k in self._attrs_cache.iterkeys():
             yield k
     else:
         attrlist = DbAttribute.list_all_node_elements(self.dbnode)
         for attr in attrlist:
             yield attr.key