Just a tip if you're not familiar with SQL, you can get django- evolution. It works with syncdb, in that syncdb will detect when an "evolution" of the db is needed like in the example above. It can't do everything, but it can do a lot if things for you, with some simple commands.
A second thing. [:1] will return a list with the first item only, however, [1] will return not the first item, but the second item of the list. If you want the first item, you should use [0] instead as python like counting from 0. On Dec 30, 5:36 am, garagefan <monkeygar...@gmail.com> wrote: > Thanks, that worked perfectly. right now i can lose the data as i'm > still learning this all. I will have to look into editing the DB via > the shell for future fixes > > On Dec 29, 11:20 pm, Daniel Roseman <roseman.dan...@googlemail.com> > wrote: > > > On Dec 29, 11:04 pm, garagefan <monkeygar...@gmail.com> wrote: > > > > awesome... it was all in that [:1]! > > > > now, next issue... > > > > "OperationalError at /admin/galleries/gallery/ > > > (1054, "Unknown column 'galleries_gallery.status' in 'field list'")" > > > > i just added the status field as i wasn't worried about any of that > > > previously... now, it appears to be causing issues. I've ran syncdb, > > > but it doesn't seem to be adding this new column. I gather it is very > > > very important to consider your required fields before syncing > > > originally... how do i go about fixing this issue? > > > > thanks again > > > Syncdb doesn't modify existing tables. If you don't have any data you > > need to keep, you can run > > ./manage.py reset galleries > > Note that this will completely delete and recreate your tables. If you > > want to preserve existing data, you'll need to go into your database > > shell (via ./manage.py dbshell) and run the SQL to modify your table > > manually - something like > > ALTER TABLE `galleries_gallery` ADD COLUMN `status` VARCHAR(1) NOT > > NULL; > > (guessing at the column definition, change as required). > > > -- > > DR. --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---