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):
|
class TicketPriority(models.Model):
|
||||||
|
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
||||||
|
|
||||||
title = models.CharField(max_length=32)
|
title = models.CharField(max_length=32)
|
||||||
colour = models.CharField(max_length=7)
|
colour = models.CharField(max_length=7)
|
||||||
|
|
||||||
@ -19,12 +21,15 @@ class TicketPriority(models.Model):
|
|||||||
|
|
||||||
def serialize(self) -> dict:
|
def serialize(self) -> dict:
|
||||||
return {
|
return {
|
||||||
|
"id": self.id,
|
||||||
"title": self.title,
|
"title": self.title,
|
||||||
"colour": self.colour
|
"colour": self.colour
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class TicketTag(models.Model):
|
class TicketTag(models.Model):
|
||||||
|
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
||||||
|
|
||||||
title = models.CharField(max_length=32)
|
title = models.CharField(max_length=32)
|
||||||
colour = models.CharField(max_length=7)
|
colour = models.CharField(max_length=7)
|
||||||
|
|
||||||
@ -33,6 +38,7 @@ class TicketTag(models.Model):
|
|||||||
|
|
||||||
def serialize(self) -> dict:
|
def serialize(self) -> dict:
|
||||||
return {
|
return {
|
||||||
|
"id": self.id,
|
||||||
"title": self.title,
|
"title": self.title,
|
||||||
"colour": self.colour
|
"colour": self.colour
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user