1
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()
AzyCrw4282
  • 5,754
  • 3
  • 13
  • 25
Emmanuel
  • 13
  • 5

1 Answers1

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")
    )
AzyCrw4282
  • 5,754
  • 3
  • 13
  • 25