I have the following model
class PhotoAlbum(models.Model):
title = models.CharField(max_length = 255)
dateCreated = models.DateTimeField()
creator = models.ForeignKey(User)
thumbnail = models.ImageField()
when I attempt to use it, I get an error saying that the table does not have a column named thumbnail. From sqlite3 I can see that the command used to create the table is:
CREATE TABLE "photos_photoalbum" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "title" varchar(255) NOT NULL, "dateCreated" datetime NOT NULL, "creator_id" integer NOT NULL REFERENCES "auth_user" ("id"));
Why doesn't django create the thumbnail column in the table? I have tried deleted and recreating the database, but it has no effect.
Aucun commentaire:
Enregistrer un commentaire