The code below this compiles, but whenever I uncomment purchase_date, po_number, or confirmed it's giving me an error. I tried python manage.py syncdb after uncommenting those lines and it's stil giving me errors.
from django.db import models
class PurchaseOrder(models.Model):
product = models.CharField(max_length=256)
vendor = models.CharField(max_length=256)
price = models.FloatField()
item_number = models.AutoField(primary_key=True)
# purchase_date = models.DateField()
# po_number = models.IntegerField(unique=True)
# confirmed = models.NullBooleanField(null=True)
The error I am getting is this:
DatabaseError at /admin/purchaseorders/purchaseorder/
column purchaseorders_purchaseorder.purchase_date does not exist
LINE 1: ...e", "purchaseorders_purchaseorder"."item_number", "purchaseo...
^
Request Method: GET
Request URL:
Django Version: 1.5.1
Exception Type: DatabaseError
Exception Value:
column purchaseorders_purchaseorder.purchase_date does not exist
LINE 1: ...e", "purchaseorders_purchaseorder"."item_number", "purchaseo...
^
Exception Location: /usr/local/lib/python2.7/dist-packages/django/db/backends/postgresql_psycopg2/base.py in execute, line 54
Python Executable: /usr/bin/python
Python Version: 2.7.3
Python Path:
['/LPG/firstproject',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-linux2',
'/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages']
Server time: Tue, 23 Jul 2013 16:30:58 +0000
Does this have anything to do with tables already being created and it wants me to clear them?