8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-05 09:26:27 +00:00
re2o/tickets/models.py
2019-08-11 19:24:40 +02:00

35 lines
999 B
Python

from django.db import models
from django.utils.translation import ugettext_lazy as _
import users.models
class Ticket(models.Model):
"""Class définissant un ticket"""
user = models.ForeignKey(
'users.User',
on_delete=models.CASCADE,
related_name="tickets")
title = models.CharField(
max_length=255,
help_text=_("Nom du ticket"),
blank=False,
null=False,)
description = models.CharField(
max_length=3000,
help_text=_("Description du ticket"),
blank=False,
null=False)
date = models.DateTimeField(auto_now_add=True)
assigned_staff = models.ForeignKey(
'users.User',
on_delete=models.PROTECT,
related_name="tickets_assigned",
blank=False,
null=True)
#categories = models.OneToManyFiled('Category')
solved = models.BooleanField(default=False)
class Meta:
verbose_name = _("Ticket")
verbose_name_plural = _("Tickets")