From cf2c1dc2682583f62d3505009f872505524e6220 Mon Sep 17 00:00:00 2001 From: Ignace Date: Sat, 3 Jan 2026 12:38:00 +0100 Subject: [PATCH] added correct sort order to items --- README.md | 2 +- items.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 73caca6..3444a38 100644 --- a/README.md +++ b/README.md @@ -5,5 +5,5 @@ list app install 1. clone repo 2. create subfolder "instance" to store database file -3. for an initial instance: run python3 initialze_data.py +3. for an initial instance: run python3 initialze_data.py, with the python from the virtual-env 4. add the below config to your apache2 enabled site diff --git a/items.py b/items.py index dfda61e..c1994b6 100644 --- a/items.py +++ b/items.py @@ -2,7 +2,7 @@ from flask import Blueprint, render_template, redirect, url_for, request from flask_login import login_required, current_user from models import db from models import User, Item -from sqlalchemy import desc +from sqlalchemy import desc, text import os from log import Log @@ -15,7 +15,7 @@ ICONPATH = "static/categories/" #without starting / and with ending / @login_required def items(listid): return render_template("items_show.html", user=current_user, - items=Item.query.filter_by(listofitems_id=listid, is_suggestion=False).order_by(Item.is_checked).all(), + items=Item.query.filter_by(listofitems_id=listid, is_suggestion=False).order_by(text("is_checked, category, label")).all(), button_top_url1 = url_for("items.items_append", listid=listid), button_top_txt1 = "add", button_top_url2 = url_for("items.items_clean", listid=listid),