Re: Problem with adding new columns to existing model.

2009-04-06 Thread Andy Mikhailenko
As Daniel suggested, try tools like django_evolution. With the latter you just do: $ ./manage.py evolve --hint -x This shows the changes to be made (--hint) and executes the migration (-x). That's it, the table structure is now synchronized to the Python class without the "alter table" pain. --~

Re: Problem with adding new columns to existing model.

2009-04-05 Thread zayatzz
Thanks to both of you. Yeah i noticed the part about alter table and doing it manually. I just hoped there is some kind of command to update the model. Just python manage.py sql appname did not work - it showed the new additions i did to model, but they did not end up in database after syncdb. Al

Re: Problem with adding new columns to existing model.

2009-04-05 Thread Daniel Roseman
On Apr 5, 11:26 am, zayatzz wrote: > Hello > > After finishing tutorial im trying to do something for myself. I > created one model and proceeded to create another ones, but then i > realised that i could just add few additional columns to existing > model, but for some reason they dont end up in

Re: Problem with adding new columns to existing model.

2009-04-05 Thread Florian Strzelecki
Hello, Hm... look at this : http://docs.djangoproject.com/en/dev/ref/models/fields/#null http://docs.djangoproject.com/en/dev/ref/models/fields/#blank So, if you want the field "optional_field", write this : class MyClass(models.Model): optional_field = models.CharField('This field is Optio

Problem with adding new columns to existing model.

2009-04-05 Thread zayatzz
Hello After finishing tutorial im trying to do something for myself. I created one model and proceeded to create another ones, but then i realised that i could just add few additional columns to existing model, but for some reason they dont end up in database table when i run python manage.py. I