replace status strings to constants

This commit is contained in:
2022-01-07 10:53:51 +00:00
parent 38630da901
commit 04b688aa06
4 changed files with 10 additions and 8 deletions

View File

@@ -20,11 +20,13 @@ class Album(models.Model):
)
description = models.TextField(null=True, blank=True)
DRAFT = "10"
PUBLIC = "20"
STATUS = (
("10", "DRAFT"),
("20", "PUBLIC"),
(DRAFT, "DRAFT"),
(PUBLIC, "PUBLIC"),
)
status = models.CharField(max_length=2, choices=STATUS, default="10")
status = models.CharField(max_length=2, choices=STATUS, default=DRAFT)
event_date = models.DateField(
verbose_name="Event Datum", null=True, blank=True, default=timezone.now