]> git.lizzy.rs Git - cheatdb.git/commitdiff
Sort notifications by date
authorrubenwardy <rw@rubenwardy.com>
Wed, 16 Sep 2020 17:16:41 +0000 (18:16 +0100)
committerrubenwardy <rw@rubenwardy.com>
Wed, 16 Sep 2020 17:16:41 +0000 (18:16 +0100)
app/models.py

index 8a7ab658c18a1f89c54d40609914a492d2a44ecf..a8a58cc750b2a209fe9a1a8d3801078fc2550a41 100644 (file)
@@ -163,7 +163,8 @@ class User(db.Model, UserMixin):
        donate_url    = db.Column(db.String(255), nullable=True, default=None)
 
        # Content
-       notifications = db.relationship("Notification", primaryjoin="User.id==Notification.user_id")
+       notifications = db.relationship("Notification", primaryjoin="User.id==Notification.user_id", \
+                       order_by="Notification.created_at")
 
        packages      = db.relationship("Package", backref=db.backref("author", lazy="joined"), lazy="dynamic")
        requests      = db.relationship("EditRequest", backref="author", lazy="dynamic")