用django.form将input改成select
from django.forms import fields from django.forms import ModelForm
class UserForm(ModelForm): phone=fields.ChoiceField() class Meta: fields='__all__' model = models.UserInfo def __init__(self,*args,**kwargs): super().__init__(*args,**kwargs) self.fields['phone'].choices=[(1,'hh'),(2,'ww')]