second patch on eboutic

This commit is contained in:
Thomas Girod
2022-11-16 20:41:24 +01:00
parent 96510b270d
commit 60eff1000f
6 changed files with 106 additions and 81 deletions

View File

@ -133,8 +133,13 @@ class ProductType(models.Model):
comment = models.TextField(_("comment"), null=True, blank=True)
icon = models.ImageField(upload_to="products", null=True, blank=True)
# priority holds no real backend logic but helps to handle the order in which
# the items are to be shown to the user
priority = models.PositiveIntegerField(default=0)
class Meta:
verbose_name = _("product type")
ordering = ["-priority", "name"]
def is_owned_by(self, user):
"""