Improve efficiency of get_tag_from_name method
This commit is contained in:
parent
ab4e147021
commit
19201eed67
@ -601,11 +601,10 @@ class DBAPI(DbGeneric):
|
|||||||
|
|
||||||
If no such Tag exists, None is returned.
|
If no such Tag exists, None is returned.
|
||||||
"""
|
"""
|
||||||
self.dbapi.execute("""select handle from tag where order_by = ?;""",
|
self.dbapi.execute("SELECT blob_data FROM tag WHERE name = ?", [name])
|
||||||
[self._order_by_tag_key(name)])
|
|
||||||
row = self.dbapi.fetchone()
|
row = self.dbapi.fetchone()
|
||||||
if row:
|
if row:
|
||||||
return self.get_tag_from_handle(row[0])
|
return Tag.create(pickle.loads(row[0]))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def get_number_of(self, obj_key):
|
def get_number_of(self, obj_key):
|
||||||
|
Loading…
Reference in New Issue
Block a user