Browse Source

Add default ordering of models by name

Colin Powell 3 năm trước cách đây
mục cha
commit
89254f49b7
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      games/models.py

+ 1 - 0
games/models.py

@@ -39,6 +39,7 @@ class BaseModel(TimeStampedModel):
     slug = AutoSlugField(populate_from="name")
 
     class Meta:
+        ordering = ['name']
         abstract = True
 
     def slugify_function(self, content):