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
+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 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),