forms类定义为 class FridgeForm(forms.ModelForm): name=forms.CharField(max_length=30,help_text="Please enter the fridge name.") temperature=forms.FloatField("温度") class Meta: model=fridge fields=('name','temperature')