Back to photostream

2006OCT110910

nextgen ~ holly data crappolla batman

Well I spy a bit of a problem adding new fields. If you want to update the schema you have to do a bit of console and MySql admin work. This is not acceptable. Why can't you update the schema like you create it?

 

 

'...

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];

...'

 

 

Here the link to the `discussion post`_. I found.

 

The steps I used

 

* python manage.py sql Notebook

 

* python manage.py dbshell

 

* alter table Notebook_entry add `date_updated` datetime NOT NULL;

 

* save the data in the table (1 field)

 

* delete * from Notebook_entry

 

* go back to the entry screen

 

* re-enter the data, then add the timestamps

 

Lots of work for 1 field and could be done at framework level to make it seamless. I thought django would have done this automatically & not me manually.

 

Notice the reStructured text representation for `urls`_. I hate them but have to practice to be able to remember. Looks like a macro is required so I don't have to remember.

 

 

.. _discussion post: www.mail-archive.com/django-users@googlegroups.com/msg146...

.. _urls: www.python.org/dev/peps/pep-0012/

 

 

next >>>

1,436 views
0 faves
1 comment
Uploaded on October 10, 2006
Taken on October 11, 2006