Price model

This commit is contained in:
imperosol
2026-03-02 15:32:57 +01:00
parent 1845a7cbcf
commit 0a3f8b8e6f
5 changed files with 201 additions and 12 deletions

View File

@@ -101,13 +101,9 @@ class ProductController(ControllerBase):
"""Get the detailed information about the products."""
return filters.filter(
Product.objects.select_related("club")
.prefetch_related("buying_groups")
.prefetch_related("prices", "prices__groups")
.select_related("product_type")
.order_by(
F("product_type__order").asc(nulls_last=True),
"product_type",
"name",
)
.order_by(F("product_type__order").asc(nulls_last=True), "name")
)