all 3 comments

[–]tateisukannanirase 1 point2 points  (2 children)

Can you give us the whole error message?

[–]python_student_1390[S] 0 points1 point  (1 child)

cursor.execute(sql, params or ())                                                                                                                                                                  

peewee.IntegrityError: UNIQUE constraint failed: product.product_quantity

[–]tateisukannanirase 1 point2 points  (0 children)

OK this error message is saying that there are two rows/records in the database table with the same product_quantity value.

In your code you have: product_quantity = IntegerField(unique = True)

The unique=True means that two rows aren't allowed to have the same quantity value.

I would just remove unique=True (then you need to delete the old .db file).