1234567891011121314 |
- from django.contrib.auth.models import Group
- from django.db import models
- class TicketList(models.Model):
- name = models.CharField(max_length=128)
- group = models.ForeignKey(Group, on_delete=models.CASCADE)
- def __str__(self):
- return self.name
- class Meta:
- ordering = ["group__name", "name"]
- unique_together = ("group", "name")
|