我有以下这个模型:
class Stock(models.Model):
name = models.CharField(max_length=50)
unit_measure = models.CharField(max_length=10)
unit_price = models.DecimalField(max_digits=10, decimal_places=2)
当我尝试在Django的管理网站中添加该模型的实例时,会出现以下错误。
(<class 'TypeError'>, TypeError('conversion from bytes to Decimal is not supported',))
Exception Location: /Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/PyMySQL-0.5-py3.3.egg/pymysql/connections.py in defaulterrorhandler, line 209
但是,通过使用phpmyadmin查看我的数据库,数据已经成功地插入到表中。
我正在使用Django1.5+Python3.3+MySQL5.5+PyMySQL。
有人对这里出了什么问题有想法吗?
admin.py
文件? - Burhan Khalid