'django.core.exceptions.ValidationError: ['“” value must be a decimal number.']
I got this error while migrating here is my models.py file:
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.']
I did makemigrations with no errors
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|