24 lines
706 B
Python
24 lines
706 B
Python
from django.db import models
|
|
|
|
# Create your models here.
|
|
from django.db import models
|
|
from django.conf import settings
|
|
|
|
class HelpdeskSubmission(models.Model):
|
|
STATUS_CHOICES = [
|
|
(1, 'Submitted'),
|
|
(2, 'Closed'),
|
|
(3, 'Open'),
|
|
]
|
|
|
|
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
|
|
title = models.CharField(max_length=200)
|
|
description = models.TextField()
|
|
image = models.ImageField(upload_to='assets/')
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
status = models.IntegerField(choices=STATUS_CHOICES, default=1) # Default status is 'Submitted'
|
|
|
|
def __str__(self):
|
|
return self.title
|
|
|