remotes/1693045480750635534/spooky-22
Aevann1 2021-09-23 21:22:18 +02:00
parent c0939815ac
commit 89abf2d26d
3 changed files with 12 additions and 2 deletions

View File

@ -142,6 +142,11 @@ class Comment(Base):
years = now.tm_year - ctd.tm_year
return f"{years}yr ago"
@property
@lazy
def score(self):
return self.upvotes - self.downvotes
@property
@lazy
def fullname(self):

View File

@ -165,6 +165,11 @@ class Submission(Base):
return str(time.strftime("%d/%B/%Y %H:%M:%S UTC", time.gmtime(self.edited_utc)))
@property
@lazy
def score(self):
return self.upvotes - self.downvotes
@property
@lazy
def hotscore(self):

View File

@ -59,7 +59,7 @@ def searchposts(v):
posts = g.db.query(Submission.id).options(
posts = g.db.query(Submission).options(
lazyload('*')
).join(
Submission.submission_aux,
@ -165,7 +165,7 @@ def searchposts(v):
total = len(posts)
ids = [x[0] for x in posts]
ids = [x.id for x in posts]