fgg
This commit is contained in:
parent
09a57dad7c
commit
61fb596548
4 changed files with 14 additions and 16 deletions
|
@ -5,13 +5,14 @@ from sqlalchemy import *
|
|||
from sqlalchemy.orm import relationship, deferred
|
||||
from files.helpers.lazy import lazy
|
||||
from files.helpers.const import SLURS
|
||||
from files.__main__ import Base, shadowbanned
|
||||
from files.__main__ import Base
|
||||
from .flags import CommentFlag
|
||||
from os import environ
|
||||
import time
|
||||
|
||||
site = environ.get("DOMAIN").strip()
|
||||
|
||||
|
||||
class Comment(Base):
|
||||
|
||||
__tablename__ = "comments"
|
||||
|
@ -356,12 +357,12 @@ class Comment(Base):
|
|||
|
||||
@property
|
||||
@lazy
|
||||
def active_flags(self): return self.ordered_flags.count()
|
||||
def active_flags(self): return self.flags.count()
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def ordered_flags(self):
|
||||
return self.flags.filter(CommentFlag.user_id.notin_(shadowbanned)).order_by(CommentFlag.id).all()
|
||||
def ordered_flags(self): return self.flags.order_by(CommentFlag.id).all()
|
||||
|
||||
|
||||
|
||||
class Notification(Base):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue