This commit is contained in:
@@ -5,10 +5,16 @@ from typing import Any
|
||||
from sqlalchemy import JSON, DateTime, ForeignKey, Index, Integer, PrimaryKeyConstraint, String
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
# Импорт Author отложен для избежания циклических импортов
|
||||
from auth.orm import Author
|
||||
from orm.base import BaseModel as Base
|
||||
from utils.logger import root_logger as logger
|
||||
|
||||
# Author уже импортирован в начале файла
|
||||
def get_author_model():
|
||||
"""Возвращает модель Author для использования в запросах"""
|
||||
return Author
|
||||
|
||||
|
||||
class NotificationEntity(Enum):
|
||||
"""
|
||||
@@ -106,7 +112,7 @@ class Notification(Base):
|
||||
status: Mapped[NotificationStatus] = mapped_column(default=NotificationStatus.UNREAD)
|
||||
kind: Mapped[NotificationKind] = mapped_column(nullable=False)
|
||||
|
||||
seen = relationship(Author, secondary="notification_seen")
|
||||
seen = relationship("Author", secondary="notification_seen")
|
||||
|
||||
__table_args__ = (
|
||||
Index("idx_notification_created_at", "created_at"),
|
||||
|
||||
Reference in New Issue
Block a user