This commit is contained in:
@@ -14,6 +14,11 @@ from sqlalchemy.orm import Mapped, mapped_column
|
||||
from auth.orm import Author
|
||||
from orm.base import BaseModel as Base
|
||||
|
||||
# Author уже импортирован в начале файла
|
||||
def get_author_model():
|
||||
"""Возвращает модель Author для использования в запросах"""
|
||||
return Author
|
||||
|
||||
|
||||
class TopicFollower(Base):
|
||||
"""
|
||||
@@ -28,7 +33,7 @@ class TopicFollower(Base):
|
||||
|
||||
__tablename__ = "topic_followers"
|
||||
|
||||
follower: Mapped[int] = mapped_column(ForeignKey(Author.id))
|
||||
follower: Mapped[int] = mapped_column(ForeignKey("author.id"))
|
||||
topic: Mapped[int] = mapped_column(ForeignKey("topic.id"))
|
||||
created_at: Mapped[int] = mapped_column(Integer, nullable=False, default=lambda: int(time.time()))
|
||||
auto: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False)
|
||||
|
||||
Reference in New Issue
Block a user