adding due_date form and model field

This commit is contained in:
tschmidt 2012-01-20 12:48:38 -08:00
parent 0f38b688a1
commit 01b0adc733
4 changed files with 175 additions and 1356 deletions

View File

@ -153,6 +153,17 @@ class TicketForm(forms.Form):
'as \'3\'.'), 'as \'3\'.'),
) )
due_date = forms.DateTimeField(
widget=extras.SelectDateWidget,
required=False,
label=_('Due on'),
)
def clean_due_date:
new_data = self.cleaned_data['due_date']
if new_data != self.instance.due_date:
print "you changed!"
attachment = forms.FileField( attachment = forms.FileField(
required=False, required=False,
label=_('Attach File'), label=_('Attach File'),
@ -235,6 +246,7 @@ class TicketForm(forms.Form):
queue = q, queue = q,
description = self.cleaned_data['body'], description = self.cleaned_data['body'],
priority = self.cleaned_data['priority'], priority = self.cleaned_data['priority'],
due_date = self.cleaned_data['due_date'],
) )
if HAS_TAG_SUPPORT: if HAS_TAG_SUPPORT:
@ -377,6 +389,12 @@ class PublicTicketForm(forms.Form):
help_text=_('Please select a priority carefully.'), help_text=_('Please select a priority carefully.'),
) )
due_date = forms.DateTimeField(
widget=extras.SelectDateWidget,
required=False,
label=_('Due on'),
)
attachment = forms.FileField( attachment = forms.FileField(
required=False, required=False,
label=_('Attach File'), label=_('Attach File'),
@ -447,6 +465,7 @@ class PublicTicketForm(forms.Form):
queue = q, queue = q,
description = self.cleaned_data['body'], description = self.cleaned_data['body'],
priority = self.cleaned_data['priority'], priority = self.cleaned_data['priority'],
due_date = self.cleaned_data['due_date'],
) )
t.save() t.save()

File diff suppressed because it is too large Load Diff

View File

@ -326,6 +326,12 @@ class Ticket(models.Model):
help_text=_('1 = Highest Priority, 5 = Low Priority'), help_text=_('1 = Highest Priority, 5 = Low Priority'),
) )
due_date = models.DateTimeField(
_('Due on'),
blank=True,
null=True,
)
last_escalation = models.DateTimeField( last_escalation = models.DateTimeField(
blank=True, blank=True,
null=True, null=True,