from django.db import models
# Create your models here.
class Product(models.Model):
##contain all product information
CONDITION_TYPE = (
("New" , "New")
("Used" , "Used")
)
name = models.CharField(max_length=100)
description = models.TextField(max_length=500)
condition = models.CharField(max_length=100 , choices=CONDITION_TYPE)
price = models.DecimalField(max_digits=10, decimal_places=5)
created = models.DateTimeField()
Asked
Active
Viewed 121 times
1
![](../../users/profiles/6505847.webp)
AzyCrw4282
- 5,754
- 3
- 13
- 25
![](../../users/profiles/12884011.webp)
Emmanuel
- 13
- 5
-
Is the problem fixed? – AzyCrw4282 May 11 '20 at 20:07
-
it is fixed thank you. – Emmanuel May 12 '20 at 22:17
1 Answers
0
As it says its a TypeError
occurring as a result of a missing comma in the tuples.
This
CONDITION_TYPE = (
("New" , "New")
("Used" , "Used")
)
Should be seprated with a comma
CONDITION_TYPE = (
("New" , "New"),
("Used" , "Used")
)
![](../../users/profiles/6505847.webp)
AzyCrw4282
- 5,754
- 3
- 13
- 25