Commit 917ae4bb authored by Anya Habana's avatar Anya Habana

Converted generic form to ModelForm

parent a71944a8
from django import forms
from .models import Department
from django.forms import ModelForm
from .models import WidgetUser
class WidgetUserForm(forms.Form):
first_name = forms.CharField(label='First Name', max_length=100)
middle_name = forms.CharField(label='Middle Name', max_length=50)
last_name = forms.CharField(label='Last Name', max_length=50)
id_num = forms.CharField(label='ID Number', max_length=7, default="")
email = forms.EmailField(label='Email Address', default="")
department = forms.ChoiceField(Department.objects)
\ No newline at end of file
class Meta:
model = WidgetUser
fields = ["first_name", "middle_name", "last_name", "id_num", "email", "department"]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment