From 7e291c028d6e4e0aa28f7b5c350bd33425709e0a Mon Sep 17 00:00:00 2001 From: Peery Date: Sun, 29 Jan 2023 21:36:00 +0100 Subject: [PATCH] Wrong Parameter when adding implications on a new tag When creating a new tag (create_tag()) the new implications were passing a dict when a name (string) was expected. Replaced the call with the ID version saving one tag lookup. --- ArtNet/db/db_adapter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ArtNet/db/db_adapter.py b/ArtNet/db/db_adapter.py index 2da7309..65cbbd4 100644 --- a/ArtNet/db/db_adapter.py +++ b/ArtNet/db/db_adapter.py @@ -639,7 +639,7 @@ class DBAdapter: for alias in aliases: self.add_alias_by_name(name, alias) for implicant in implications: - self.add_implication_by_name(name, implicant) + self.add_implication_by_ID(self.get_tag_ID(name), implicant['id']) self.db.commit() @@ -755,6 +755,7 @@ class DBAdapter: d) self.db.commit() + @DeprecationWarning def add_implication_by_name(self, name: str, implicant: str): """ Add the implication to the database @@ -762,6 +763,8 @@ class DBAdapter: :param implicant: :return: """ + logging.warning("This method is deprecated! Please resolve the name and use add_implication_by_id() instead.") + print(f"Name: {name} ({self.get_tag_ID(name)}), implcant: {implicant} ({self.get_tag_ID(implicant)})") self.add_implication_by_ID(self.get_tag_ID(name), self.get_tag_ID(implicant)) def remove_implication_by_ID(self, tag: int, implicant: int):