Hello World! So heres my problem: I'm using a mysql database. I want to add another column to one of the tables in it, and have successfully done so from the mysql interface on the control panel. Do I have to do something special to get it to show up in my models.py file? Because my function aren't "seeing" the new column in the table. Thanks, Sean asked 06 Nov '10, 10:00 Sean Lambert seanf |
When I say it doesn't "see" the new column, I mean that when I try to call the table (eg. Object.newColumn), it says something along the lines of Object doesn't have attribute/item newColumn
Did you add new field to your models.py before (or after, it doesn't matter) you added the column to your table?
Judging from the error (missing attribute) you haven't done this yet.
Yeah. I'm really still new to this. So far, every time I needed to add something to the database i just updated models.py, deleted the DB, the did syncdb again (i know, i'm terrible). But now that I've launched I can't afford to lose the data already the DB. Thanks for the help. I just made identical changes to models.py and the DB and now it works.
Thanks!