event.py 521 B

1234567891011121314151617181920
  1. import textwrap
  2. from django.contrib.auth import get_user_model
  3. from django.db import models
  4. from tickets.models.ticket import Ticket
  5. class Event(models.Model):
  6. author = models.ForeignKey(
  7. get_user_model(), on_delete=models.CASCADE, blank=True, null=True,
  8. related_name="tickets_events"
  9. )
  10. ticket = models.ForeignKey(Ticket, on_delete=models.CASCADE)
  11. date = models.DateTimeField(auto_now_add=True)
  12. body = models.TextField(blank=True)
  13. def __str__(self):
  14. return self.body