From 8d8165a0d7fbd4ee9281ef3732e93a02720305af Mon Sep 17 00:00:00 2001 From: rr- Date: Sun, 8 Jan 2017 21:42:22 +0100 Subject: [PATCH] server/tags: fix order of aliases in export fixes #112 --- server/szurubooru/func/tags.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/szurubooru/func/tags.py b/server/szurubooru/func/tags.py index fa4ee00..ece1231 100644 --- a/server/szurubooru/func/tags.py +++ b/server/szurubooru/func/tags.py @@ -104,7 +104,10 @@ def export_to_json(): 'color': result[2], } - for result in db.session.query(db.TagName.tag_id, db.TagName.name).all(): + for result in (db.session + .query(db.TagName.tag_id, db.TagName.name) + .order_by(db.TagName.order) + .all()): if not result[0] in tags: tags[result[0]] = {'names': []} tags[result[0]]['names'].append(result[1])