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 828B

1234567891011121314151617181920212223242526272829303132333435363738
  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', 'status', 'waiting_for', 'assigned_to')
  17. class FollowupForm(forms.ModelForm):
  18. class Meta:
  19. model = FollowUp
  20. fields = ('ticket', 'title', 'text', 'user')
  21. class AttachmentForm(forms.ModelForm):
  22. class Meta:
  23. model = Attachment
  24. fields = ('file',)