On 9/20/06, Tool69 <[EMAIL PROTECTED]> wrote: > > Hi, > I'm totally new to django, I've made a little blog application and my > original template is like this one: > > class News(models.Model): > title = models.CharField(maxlength=255, verbose_name="Titre du > billet") > text = models.TextField(verbose_name="Contenu") > keywords = models.CharField(maxlength=255, verbose_name="Mots > clés") > date = models.DateTimeField(verbose_name="Date de publication") > etc. > > All is getting well but now (runnin it with MySQL on WebFaction), I > wanted to stick an image with each post, so I added that field to my > News class : > > post_image = models.ImageField(upload_to='entetes/', blank=True, > help_text="Doit etre de 300px de large") > > But now, I received an error message saying : > (1054, "Unknown column 'news_news.supplementary_image' in 'field > list'") > > What's going wrong ?
You'll need to hand-update your table schema. If you run: ./manage.py sql appname it willl print the new schema. Then you can run: ./manage.py dbshell and then do: alter table news.news add [new column definition goes here]; Alternatively, you can dump that table, DROP it, use manage.py syncdb to re-create it, and then reload the dumped table (minus schema). I usually use alter table. I think there are plans to have Django modify existing schemas when the models change, but it's not implemented yet. -- This message has been scanned for memes and dangerous content by MindScanner, and is believed to be unclean. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---