Order categories and products alphabetically.
This commit is contained in:
parent
9be3e62842
commit
ee4c0819e4
|
@ -10,6 +10,9 @@ class ProductCategory(CampRelatedModel):
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
ordering = ("name",)
|
||||||
|
|
||||||
|
|
||||||
class Product(models.Model):
|
class Product(models.Model):
|
||||||
name = models.CharField(max_length=255)
|
name = models.CharField(max_length=255)
|
||||||
|
@ -17,5 +20,8 @@ class Product(models.Model):
|
||||||
category = models.ForeignKey(ProductCategory, related_name="products")
|
category = models.ForeignKey(ProductCategory, related_name="products")
|
||||||
in_stock = models.BooleanField(default=True)
|
in_stock = models.BooleanField(default=True)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
ordering = ("name",)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
Loading…
Reference in a new issue