diff --git a/la_chariotte/order/migrations/0024_alter_item_options.py b/la_chariotte/order/migrations/0024_alter_item_options.py new file mode 100644 index 0000000..5b33a6d --- /dev/null +++ b/la_chariotte/order/migrations/0024_alter_item_options.py @@ -0,0 +1,16 @@ +# Generated by Django 4.2.1 on 2023-07-25 08:20 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("order", "0023_order_created_date_order_note"), + ] + + operations = [ + migrations.AlterModelOptions( + name="item", + options={"ordering": ["name"]}, + ), + ] diff --git a/la_chariotte/order/models.py b/la_chariotte/order/models.py index 4148156..7434e7c 100644 --- a/la_chariotte/order/models.py +++ b/la_chariotte/order/models.py @@ -146,6 +146,9 @@ class Item(models.Model): def __str__(self): # pragma: no cover return f"{self.name} ({self.price} €)" + class Meta: + ordering = ["name"] + class OrderedItem(models.Model): """Item in one specific Order, and the number of articles""" diff --git a/la_chariotte/order/templates/order/grouped_order_add_items.html b/la_chariotte/order/templates/order/grouped_order_add_items.html index fb6e902..10cebf2 100644 --- a/la_chariotte/order/templates/order/grouped_order_add_items.html +++ b/la_chariotte/order/templates/order/grouped_order_add_items.html @@ -27,8 +27,8 @@