1
0

ticket_list.py 388 B

1234567891011121314151617
  1. from django.contrib.auth.models import Group
  2. from django.db import models
  3. class TicketList(models.Model):
  4. # DATA
  5. name = models.CharField(max_length=128)
  6. # FK
  7. group = models.ForeignKey(Group, on_delete=models.CASCADE)
  8. def __str__(self):
  9. return self.name
  10. class Meta:
  11. ordering = ["group__name", "name"]
  12. unique_together = ("group", "name")