mirror of
https://github.com/Hopiu/django-select2.git
synced 2026-04-01 21:00:24 +00:00
parent
8f14e64701
commit
94c3d5bd21
1 changed files with 10 additions and 3 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue