c3lf-system-3/core/tickets/models.py

23 lines
696 B
Python
Raw Normal View History

2023-11-23 22:17:20 +00:00
from django.db import models
from django_softdelete.models import SoftDeleteModel
from inventory.models import Event
class IssueThread(SoftDeleteModel):
id = models.AutoField(primary_key=True)
class Comment(models.Model):
id = models.AutoField(primary_key=True)
issue_thread = models.ForeignKey(IssueThread, on_delete=models.CASCADE)
comment = models.TextField()
timestamp = models.DateTimeField(auto_now_add=True)
class StateChange(models.Model):
id = models.AutoField(primary_key=True)
issue_thread = models.ForeignKey(IssueThread, on_delete=models.CASCADE)
state = models.CharField(max_length=255)
timestamp = models.DateTimeField(auto_now_add=True)