added correct sort order to items

This commit is contained in:
2026-01-03 12:38:00 +01:00
parent 9cb77d2fbd
commit cf2c1dc268
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -5,5 +5,5 @@ list app
install install
1. clone repo 1. clone repo
2. create subfolder "instance" to store database file 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 4. add the below config to your apache2 enabled site
+2 -2
View File
@@ -2,7 +2,7 @@ from flask import Blueprint, render_template, redirect, url_for, request
from flask_login import login_required, current_user from flask_login import login_required, current_user
from models import db from models import db
from models import User, Item from models import User, Item
from sqlalchemy import desc from sqlalchemy import desc, text
import os import os
from log import Log from log import Log
@@ -15,7 +15,7 @@ ICONPATH = "static/categories/" #without starting / and with ending /
@login_required @login_required
def items(listid): def items(listid):
return render_template("items_show.html", user=current_user, 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_url1 = url_for("items.items_append", listid=listid),
button_top_txt1 = "add", button_top_txt1 = "add",
button_top_url2 = url_for("items.items_clean", listid=listid), button_top_url2 = url_for("items.items_clean", listid=listid),