try: fix search

This commit is contained in:
cwilvx
2025-02-25 20:53:39 +03:00
parent 7daa20e0df
commit 0a1ab72932
11 changed files with 196 additions and 181 deletions
+2 -8
View File
@@ -519,16 +519,10 @@ class LibDataTable(Base):
@classmethod
def get_all_colors(cls, type: str) -> Iterable[dict[str, str]]:
result = cls.execute(
select(cls.itemhash, cls.color).where(cls.itemtype == type)
)
# return [
# {"itemhash": r[0].replace(type, ""), "color": r[1]}
# for r in result.fetchall()
# ]
result = cls.execute(select(cls).where(cls.itemtype == type))
for i in next(result).scalars():
yield {"itemhash": i[0].replace(type, ""), "color": i[1]}
yield {"itemhash": i.itemhash.replace(type, ""), "color": i.color}
class MixTable(Base):