from django.contrib.auth.models import Group
from django.db import models


class TicketList(models.Model):
    # DATA
    name = models.CharField(max_length=128)

    # FK
    group = models.ForeignKey(Group, on_delete=models.CASCADE)

    def __str__(self):
        return self.name

    class Meta:
        ordering = ["group__name", "name"]
        unique_together = ("group", "name")