Beispiel #1
0
 def _del_db_extra(self, key):
     from aiida.backends.djsite.db.models import DbExtra
     if not DbExtra.has_key(self.dbnode, key):
         raise AttributeError("DbExtra {} does not exist".format(
             key))
     return DbExtra.del_value_for_node(self.dbnode, key)
     self._increment_version_number_db()
Beispiel #2
0
 def del_extra(self, key):
     from aiida.backends.djsite.db.models import DbExtra
     if self._to_be_stored:
         raise ModificationNotAllowed(
             "The extras of a node can be set and deleted "
             "only after storing the node")
     if not DbExtra.has_key(self.dbnode, key):
         raise AttributeError("DbExtra {} does not exist".format(key))
     return DbExtra.del_value_for_node(self.dbnode, key)
     self._increment_version_number_db()