You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.5 KiB
Python
39 lines
1.5 KiB
Python
from django.db import models
|
|
from billing.models import *
|
|
# Create your models here.
|
|
|
|
class Ticket(models.Model):
|
|
REGARDING_CHOICES = (
|
|
('General/Account/Billing', 'General/Account/Billing'),
|
|
('Project/Product', 'Project/Product'),
|
|
)
|
|
title = models.CharField(max_length=400)
|
|
description = models.TextField(null=True, blank=True)
|
|
regarding = models.CharField(max_length=50, choices=REGARDING_CHOICES, null=True)
|
|
project = models.ForeignKey(Project, on_delete=models.SET_NULL, blank=True, null=True)
|
|
product = models.ForeignKey(Item, on_delete=models.SET_NULL, blank=True, null=True)
|
|
department = models.ForeignKey(Department, on_delete=models.SET_NULL,null=True)
|
|
opened_by = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)
|
|
opened_date = models.DateTimeField()
|
|
|
|
|
|
class TicketUpdate(models.Model):
|
|
ticket = models.ForeignKey(Ticket, on_delete=models.CASCADE)
|
|
description = models.TextField(null=True, blank=True)
|
|
added_by = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)
|
|
date_added = models.DateTimeField()
|
|
|
|
|
|
class TicketAttachment(models.Model):
|
|
ticket = models.ForeignKey(Ticket, on_delete=models.CASCADE)
|
|
ticket_update = models.ForeignKey(TicketUpdate, on_delete=models.CASCADE)
|
|
file = models.FileField()
|
|
|
|
|
|
class TicketReaction(models.Model):
|
|
REGARDING_CHOICES = (
|
|
('Happy', 'Happy'),
|
|
('Indifferent', 'Indifferent'),
|
|
('Sad', 'Sad'),
|
|
)
|
|
ticket_update = models.ForeignKey(TicketUpdate, on_delete=models.CASCADE) |