feat: added ticket history
This commit is contained in:
@@ -36,3 +36,16 @@ class Comment(models.Model):
|
||||
|
||||
def __str__(self):
|
||||
return f"Kommentar von {self.author} zu Ticket #{self.ticket.id}"
|
||||
|
||||
|
||||
class TicketHistory(models.Model):
|
||||
ticket = models.ForeignKey("Ticket", on_delete=models.CASCADE, related_name="history")
|
||||
changed_by = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)
|
||||
changed_at = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
field = models.CharField(max_length=100) # z. B. "status" oder "description"
|
||||
old_value = models.TextField(null=True, blank=True)
|
||||
new_value = models.TextField(null=True, blank=True)
|
||||
|
||||
class Meta:
|
||||
ordering = ["-changed_at"]
|
||||
|
||||
Reference in New Issue
Block a user