I'm new for python,I build a table in models.py like this:
class book(models.Model):
name = models.CharField(max_length = 20)
grade = models.CharField(max_length = 20, blank = True, null = True)
def __unicode__(self):
return self.name +self.grade + self.nick
now ,I want to insert a column to the table book,when I rewrite the code :
class book(models.Model):
name = models.CharField(max_length = 20)
grade = models.CharField(max_length = 20, blank = True, null = True)
nick = models.CharField(max_length = 20)
def __unicode__(self):
return self.name +self.grade + self.nick
but,when I run the command :python manage.py syncdb is OK but,when I run :
from db.models import book book.objects.all() here is wrong,
OperationalError: no such column: db_book.nick
I really don't know how to change it ,by the way ,how to drop the whole table?just like in MySQL? thanks