Added UUID to TicketTag & TicketPriority Models
These models now use a UUID identifier over an auto incrementing integer identifier.
This commit is contained in:
parent
16de4e50a6
commit
acd3c2c5ba
@ -11,6 +11,8 @@ from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class TicketPriority(models.Model):
|
||||
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
||||
|
||||
title = models.CharField(max_length=32)
|
||||
colour = models.CharField(max_length=7)
|
||||
|
||||
@ -19,12 +21,15 @@ class TicketPriority(models.Model):
|
||||
|
||||
def serialize(self) -> dict:
|
||||
return {
|
||||
"id": self.id,
|
||||
"title": self.title,
|
||||
"colour": self.colour
|
||||
}
|
||||
|
||||
|
||||
class TicketTag(models.Model):
|
||||
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
||||
|
||||
title = models.CharField(max_length=32)
|
||||
colour = models.CharField(max_length=7)
|
||||
|
||||
@ -33,6 +38,7 @@ class TicketTag(models.Model):
|
||||
|
||||
def serialize(self) -> dict:
|
||||
return {
|
||||
"id": self.id,
|
||||
"title": self.title,
|
||||
"colour": self.colour
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user