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.
dev
Peery 1 year ago
parent bcc39c5147
commit 7e291c028d
Signed by: pandro
SSH Key Fingerprint: SHA256:iBUZSuDxqYr4hYpe9U3BA9NJmXKpbGt4H0S8hUwIbrA

@ -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):

Loading…
Cancel
Save