A simple ticketing application written in Python/Django
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

forms.py 838B

123456789101112131415161718192021222324252627282930313233343536373839
  1. # -*- coding: utf-8 -*-
  2. from django import forms
  3. from django.contrib.auth.models import User
  4. from .models import Ticket, FollowUp, Attachment
  5. class UserSettingsForm(forms.ModelForm):
  6. class Meta:
  7. model = User
  8. fields = ('first_name', 'last_name', 'email',)
  9. class TicketCreateForm(forms.ModelForm):
  10. class Meta:
  11. model = Ticket
  12. fields = ('title', 'description')
  13. class TicketEditForm(forms.ModelForm):
  14. class Meta:
  15. model = Ticket
  16. fields = ('title', 'owner', 'description',
  17. 'status', 'waiting_for', 'assigned_to')
  18. class FollowupForm(forms.ModelForm):
  19. class Meta:
  20. model = FollowUp
  21. fields = ('ticket', 'title', 'text', 'user')
  22. class AttachmentForm(forms.ModelForm):
  23. class Meta:
  24. model = Attachment
  25. fields = ('file',)