From 8ba9a48d9ef2f18e13296cdf376a4c673abe135a Mon Sep 17 00:00:00 2001 From: lauren Date: Wed, 11 Nov 2020 14:29:53 -0500 Subject: [PATCH] order tags alphabetically --- studyguides/apps/courses/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/studyguides/apps/courses/models.py b/studyguides/apps/courses/models.py index 1e75905..aa57066 100644 --- a/studyguides/apps/courses/models.py +++ b/studyguides/apps/courses/models.py @@ -41,5 +41,8 @@ class Tag(models.Model): url = models.SlugField(max_length=100, unique=True, null=True, validators=[RegexValidator( regex="^[a-z0-9_\-]+$", message="Only lowercase alphanumeric, dashes, and underscores allowed")]) + class Meta: + ordering = ['url'] + def __str__(self): return self.name \ No newline at end of file