[#255] Model variables as entities #256

Merged
blacklight merged 14 commits from 255-model-variables-as-entities into master 2023-04-29 18:24:25 +02:00
1 changed files with 5 additions and 1 deletions
Showing only changes of commit e96885a805 - Show all commits

View File

@ -64,7 +64,11 @@ class VariablePlugin(Plugin, EntityManager):
:param name: Name of the variable to remove.
"""
self.publish_entities({name: None})
with self._db.get_session() as session:
entity = session.query(Variable).filter(Variable.name == name).first()
if entity is not None:
self._entities.delete(entity.id)
self._db_vars.pop(name, None)
return True