models.py 559 B

123456789101112131415161718
  1. from django.db import models
  2. from organizations_ext.models import Organization
  3. from glitchtip.base_models import CreatedModel
  4. class Team(CreatedModel):
  5. slug = models.SlugField()
  6. organization = models.ForeignKey(
  7. Organization, on_delete=models.CASCADE, related_name="teams"
  8. )
  9. members = models.ManyToManyField("organizations_ext.OrganizationUser", blank=True)
  10. projects = models.ManyToManyField("projects.Project")
  11. class Meta:
  12. unique_together = ("slug", "organization")
  13. def __str__(self):
  14. return self.slug