0

迁移时出现此错误是我的 models.py 文件:

from django.db import models
from django.conf import settings
from decimal import Decimal
# Create your models here.
class Pharmacy(models.Model):
    user=models.ForeignKey(settings.AUTH_USER_MODEL,
        on_delete=models.CASCADE)
    Title = models.CharField(max_length=200)
    description=models.TextField()
    feed=models.DecimalField(max_digits=5,decimal_places=1,default=Decimal('1.0'),null=True)
    def __str__(self):
        return self.Title
class feedback(models.Model):
    phid=models.ForeignKey(Pharmacy,on_delete=models.CASCADE)
    value=models.DecimalField(max_digits=5.,decimal_places=0,default=Decimal('1.0'),null=True)

django.core.exceptions.ValidationError: ['“” value must be a decimal number.']

我做了没有错误的迁移

4

0 回答 0