问题
this is my code i have just started learning ddjango and got stuck here. I added address and status a few days after the other columns i get this error
params={'value': value}, django.core.exceptions.ValidationError: ["'' value must be either True or False."]
from django.db import models
class product(models.Model):
prodid = models.IntegerField(("ID"))
name = models.CharField(("Product Name"), max_length=100,unique ="true")
price = models.IntegerField()
star = models.IntegerField()
def __str__(self):
return self.name
class cart (models.Model):
product = models.ForeignKey(product , on_delete=models.CASCADE)
quantity = models.IntegerField()
address = models.CharField(("Address"), max_length=300, default='')
status = models.BooleanField(default=True)
def __str__(self):
return product
来源:https://stackoverflow.com/questions/59235569/params-value-value-django-core-exceptions-validationerror-value-must