From 94c3d5bd21be57504a113506d3f42997cff9015e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ociepka?= Date: Sat, 8 Jun 2013 10:15:45 +0200 Subject: [PATCH] Add the school form Issue #43 --- testapp/testapp/testmain/forms.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/testapp/testapp/testmain/forms.py b/testapp/testapp/testmain/forms.py index b4f8b06..bec0fe2 100644 --- a/testapp/testapp/testmain/forms.py +++ b/testapp/testapp/testmain/forms.py @@ -2,7 +2,7 @@ from django import forms from django_select2 import * -from .models import Employee, Dept, ClassRoom, Lab, Word +from .models import Employee, Dept, ClassRoom, Lab, Word, School from django.core.exceptions import ValidationError @@ -78,12 +78,19 @@ class SelfMultiChoices(AutoSelect2MultipleField): return (NO_ERR_RESP, False, res) -########### Forms ############## +########### Forms ##############] + +class SchoolForm(forms.ModelForm): + + classes = ClassRoomChoices() + + class Meta: + model = School class EmployeeForm(forms.ModelForm): manager = EmployeeChoices(required=False) dept = ModelSelect2Field(queryset=Dept.objects) - + class Meta: model = Employee