WEB-APP/ Optimization/ Build fix/ Hotkey edit mode/ Log rotation/ Form a11y/ E2E non-blocking

This commit is contained in:
Vladless
2026-04-13 00:38:29 +00:00
parent c1b9b20ea3
commit c693c28ee7
270 changed files with 20933 additions and 6365 deletions
+21
View File
@@ -0,0 +1,21 @@
from sqlalchemy.orm import declarative_base
Base = declarative_base()
class DictLikeMixin:
"""Позволяет обращаться к ORM-объектам как к словарю.
Используется legacy-кодом, который мигрировал с dict-результатов asyncpg
на ORM и не хочет переписывать все `row["field"]` / `row.get("field")`.
"""
def __getitem__(self, key):
return getattr(self, key)
def get(self, key, default=None):
return getattr(self, key, default)
def to_dict(self):
return {column.name: getattr(self, column.name) for column in self.__table__.columns}