Py学习  »  Django

django表单提交数据有问题

452370284 • 6 年前 • 754 次点击  

创建的表单点击提交后报错unorderable types: float() > str() 我模型数据定义的float型,不明白在那儿保存为str型报错了,有老哥知道吗?急求!

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/1810
 
754 次点击  
文章 [ 1 ]  |  最新文章 6 年前
452370284
Reply   •   1 楼
452370284    6 年前

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')