forked from rDrama/rDrama
master
parent
df66febb5c
commit
bfd0d04d9f
|
@ -371,12 +371,12 @@ class User(Base, Stndrd, Age_times):
|
|||
|
||||
@cache.memoize(timeout=86400)
|
||||
def notification_messages(self, page=1):
|
||||
comments = g.db.query(Comment).filter(or_(Comment.author_id==self.id, Comment.sentto==self.id), Comment.parent_submission == None).order_by(Comment.created_utc.desc()).limit(100).all()
|
||||
comments = g.db.query(Comment).filter(or_(Comment.author_id==self.id, Comment.sentto==self.id), Comment.parent_submission == None).order_by(Comment.created_utc.desc()).all()
|
||||
|
||||
comments = [c.id for c in comments if c.child_comments == []]
|
||||
|
||||
firstrange = 25 * (page - 1)
|
||||
secondrange = firstrange + 26
|
||||
firstrange = 100 * (page - 1)
|
||||
secondrange = firstrange + 101
|
||||
return comments[firstrange:secondrange]
|
||||
|
||||
@property
|
||||
|
|
Loading…
Reference in New Issue