From e2743db969f53c56933c9a967bb58e9a2aab4a7c Mon Sep 17 00:00:00 2001 From: pi3c Date: Mon, 16 Oct 2023 19:36:02 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D1=81=D0=BE=D1=80=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=BA?= =?UTF-8?q?=D1=83=20=D0=BF=D0=BE=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproger/dbase/database.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproger/dbase/database.py b/pyproger/dbase/database.py index c6190a1..d18c8fe 100644 --- a/pyproger/dbase/database.py +++ b/pyproger/dbase/database.py @@ -7,7 +7,7 @@ def get_paginated_posts(page, per_page): db.session.query(Post, User) .join(User, Post.author == User.id) .filter(Post.published.is_(True)) - .order_by(Post.create_datetime.desc()) + .order_by(Post.update_datetime.desc()) .paginate(page=page, per_page=per_page, error_out=True) ) return all_post_query, all_post_query.total @@ -35,7 +35,7 @@ def get_all_posts_by_tag(tag, page, per_page): .join(User, Post.author == User.id) .filter(Post.published.is_(True)) .filter(Post.tags.any(Tag.tag == tag)) - .order_by(Post.create_datetime.desc()) + .order_by(Post.update_datetime.desc()) .paginate(page=page, per_page=per_page, error_out=True) ) if posts_query.total == 0: