So this is the situation: I'm adding a new column(presenters) to my Event table. I ran the alter table
sql statements, ran python manage.py syncdb
. I'm trying to be able to select many profiles and store them as presenters. Why is this happening?
Exception Type: DatabaseError
Exception Value: no such table: events_event_presenters
class Event(models.Model):
title = models.CharField(max_length=200)
presenters = models.ManyToManyField(Profile, null=True, blank=True) #new column
sub_heading = models.CharField(max_length=200)
description = models.TextField()
date = models.DateTimeField()
You've added a ManyToMany field to an existing table, which won't be detected by syncdb. Seems like a deficiency on django's part to me, but I guess it's minor. The easiest way to generate the table will be to run
./manage.py sql events
then find the definition for events_event_presenters
and paste into your database shell, via
./manage.py dbshell
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With