2020
09-24
09-24
Django choices下拉列表绑定实例
Models内容fromdjango.dbimportmodelsfromdjangoimportforms#Createyourmodelshere.classSysConfigForm(forms.Form):DatabaseType=forms.ChoiceField(choices=[('sqlserver','SQLServer'),('oracle','Oracle')])classUserInfo(forms.Form):vip_type=((0,u'普通用户'),(1,u'高级用户'),)vip=forms.CharField(widget=forms.widgets.Select(choices=vip_type,attrs={'class':'form-control','with':'25p...
继续阅读 >