当我运行一个说明ModelSelect2MultipleField
未定义的程序时,我收到错误。我在这里用它:
from django import forms
from django_select2 import *
from django.db.models import Q
from contacts.models import Contact
from cards.models import JobCard
from employee.models import *
from django.core.exceptions import ValidationError
def validate_fail_always(value):
raise ValidationError(u'%s not valid. Infact nothing is valid!' % value)
########### Forms ##############]
class GetContactSearchForm(forms.Form):
clients = ModelSelect2MultipleField(queryset=Contact.objects, required=False)
class GetEmployeeSearchForm(forms.Form):
employees = ModelSelect2MultipleField(queryset=Employee.objects, required=False)
我的python
版本为2.7.10
,我的django
为1.8
;我应该用我的settings.py
文件替换那个字段,或者我需要安装或放入其他东西吗?
谢谢!