viewstable

This commit is contained in:
2022-11-18 20:54:37 +03:00
parent 8975e003a9
commit c839f63036
3 changed files with 107 additions and 0 deletions

13
orm/viewed.py Normal file
View File

@@ -0,0 +1,13 @@
from datetime import datetime
from sqlalchemy import Column, DateTime, ForeignKey
from base.orm import Base
class ViewedEntry(Base):
__tablename__ = "viewed"
viewer = Column(ForeignKey("user.slug"), default='anonymous')
shout = Column(ForeignKey("shout.slug"))
createdAt = Column(
DateTime, nullable=False, default=datetime.now, comment="Created at"
)