# Path: tickets/models.py
# class TicketMessage(models.Model):
#     ticket = models.ForeignKey(Ticket, related_name='message_set',
#                                on_delete=models.CASCADE)
#     user = models.ForeignKey(settings.AUTH_USER_MODEL, blank=True, null=True,
#                              on_delete=models.SET_NULL)
#     remote_addr = models.GenericIPAddressField(blank=True, null=True)
#     created = models.DateTimeField(auto_now_add=True)
#     message = models.TextField()
#     staff_only = models.BooleanField(default=False)
# 
#     class Meta:
#         ordering = ('created',)
# 
# CATEGORY_CHOICES = (
#     ('support', _("Support")),
#     ('security', _("Security")),
#     ('billing', _("Account / Billing")),
# )


from django import forms
from .models import TicketMessage, CATEGORY_CHOICES
from django.utils.translation import ugettext_lazy as _


class NewTicketForm(forms.Form):
    category = forms.ChoiceField(label=_("Category"), choices=CATEGORY_CHOICES)
    subject = forms.CharField(label=_("Subject"), min_length=1, max_length=100)
    message = forms.CharField(label=_("Message"), widget=forms.Textarea)


class ReplyForm(forms.ModelForm):
    class Meta:

# Path: tickets/models.py
# class TicketMessage(models.Model):
#     ticket = models.ForeignKey(Ticket, related_name='message_set',
#                                on_delete=models.CASCADE)
#     user = models.ForeignKey(settings.AUTH_USER_MODEL, blank=True, null=True,
#                              on_delete=models.SET_NULL)
#     remote_addr = models.GenericIPAddressField(blank=True, null=True)
#     created = models.DateTimeField(auto_now_add=True)
#     message = models.TextField()
#     staff_only = models.BooleanField(default=False)
# 
#     class Meta:
#         ordering = ('created',)
# 
# CATEGORY_CHOICES = (
#     ('support', _("Support")),
#     ('security', _("Security")),
#     ('billing', _("Account / Billing")),
# )


# Path: tickets/forms.py
from django import forms
from .models import TicketMessage, CATEGORY_CHOICES
from django.utils.translation import ugettext_lazy as _



class NewTicketForm(forms.Form):
    category = forms.ChoiceField(label=_("Category"), choices=CATEGORY_CHOICES)
    subject = forms.CharField(label=_("Subject"), min_length=1, max_length=100)
    message = forms.CharField(label=_("Message"), widget=forms.Textarea)


class ReplyForm(forms.ModelForm):
    class Meta:

        model = TicketMessage