def extras(self): from aiida.backends.djsite.db.models import DbExtra if self._to_be_stored: return else: extraslist = DbExtra.list_all_node_elements(self.dbnode) for e in extraslist: yield e.key
def iterextras(self): from aiida.backends.djsite.db.models import DbExtra if self._to_be_stored: # If it is not stored yet, there are no extras that can be # added (in particular, we do not even have an ID to use!) # Return without value, meaning that this is an empty generator return else: extraslist = DbExtra.list_all_node_elements(self.dbnode) for e in extraslist: yield (e.key, e.getvalue())
def _db_iterextras(self): from aiida.backends.djsite.db.models import DbExtra extraslist = DbExtra.list_all_node_elements(self.dbnode) for e in extraslist: yield (e.key, e.getvalue())