gf
This commit is contained in:
parent
817d63b033
commit
6721538b81
7 changed files with 29 additions and 16 deletions
|
@ -450,10 +450,14 @@ class Notification(Base):
|
|||
user_id = Column(Integer, ForeignKey("users.id"))
|
||||
comment_id = Column(Integer, ForeignKey("comments.id"))
|
||||
read = Column(Boolean, default=False)
|
||||
created_utc = Column(Integer)
|
||||
|
||||
comment = relationship("Comment", viewonly=True)
|
||||
user = relationship("User", viewonly=True)
|
||||
|
||||
def __repr__(self):
|
||||
def __init__(self, *args, **kwargs):
|
||||
if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time())
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
return f"<Notification(id={self.id})>"
|
||||
def __repr__(self):
|
||||
return f"<Notification(id={self.id})>"
|
Loading…
Add table
Add a link
Reference in a new issue