From 5fde397c4a6aab9503e0ffa4b9e3d2f79ab54154 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Mon, 15 Aug 2016 16:02:12 +0200 Subject: [PATCH] Sort reverse chronologically on tag pages too --- digimarks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/digimarks.py b/digimarks.py index f93575f..f9c4671 100644 --- a/digimarks.py +++ b/digimarks.py @@ -467,7 +467,7 @@ def tags(userkey): @app.route('//tag/') def tag(userkey, tag): """ Overview of all bookmarks with a certain tag """ - bookmarks = Bookmark.select().where(Bookmark.userkey == userkey, Bookmark.tags.contains(tag), Bookmark.status == Bookmark.VISIBLE) + bookmarks = Bookmark.select().where(Bookmark.userkey == userkey, Bookmark.tags.contains(tag), Bookmark.status == Bookmark.VISIBLE).order_by(Bookmark.created_date.desc()) tags = get_tags_for_user(userkey) pageheader = 'tag: ' + tag message = request.args.get('message') @@ -486,7 +486,7 @@ def publictag(tagkey): #this_tag = get_object_or_404(PublicTag.select().where(PublicTag.tagkey == tagkey)) try: this_tag = PublicTag.get(PublicTag.tagkey == tagkey) - bookmarks = Bookmark.select().where(Bookmark.userkey == this_tag.userkey, Bookmark.tags.contains(this_tag.tag), Bookmark.status == Bookmark.VISIBLE) + bookmarks = Bookmark.select().where(Bookmark.userkey == this_tag.userkey, Bookmark.tags.contains(this_tag.tag), Bookmark.status == Bookmark.VISIBLE).order_by(Bookmark.created_date.desc()) return render_template('publicbookmarks.html', bookmarks=bookmarks, tag=tag, action=this_tag.tag, tagkey=tagkey) except PublicTag.DoesNotExist: abort(404)