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.
--~
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
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
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
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
5 matches
Mail list logo