Order categories and products alphabetically.

This commit is contained in:
Vidir Valberg Gudmundsson 2017-08-26 20:28:11 +02:00
parent 9be3e62842
commit ee4c0819e4

View file

@ -10,6 +10,9 @@ class ProductCategory(CampRelatedModel):
def __str__(self):
return self.name
class Meta:
ordering = ("name",)
class Product(models.Model):
name = models.CharField(max_length=255)
@ -17,5 +20,8 @@ class Product(models.Model):
category = models.ForeignKey(ProductCategory, related_name="products")
in_stock = models.BooleanField(default=True)
class Meta:
ordering = ("name",)
def __str__(self):
return self.name