Modify Model after Activation

5 views
Skip to first unread message

Glyn Price

unread,
Dec 4, 2014, 2:19:12 PM12/4/14
to econsens...@googlegroups.com
Modify Model after Activation

After activating the Model, modifying database related items is not straight forward for me. Example of such items are: number of fields in
the table, name of table & names of fields.

For now, rather than investigate the relevant migration methods, I noticed that if I did the changes to the Model as part of the following
sequence then I seemed to be successful: delete db.sqlite3; delete the polls/migrations/0001_initial.py;
python manage.py migrate; python manage.py createsuperuser; modify database related items in models.py;
the 4 commands line involved with the model activation and lastly the straight forward changes in, for example,
views.py, models.py (non-database related) & latest_list.html.

By using this method I've lost the data in db.sqlite3, but at the stage I'm at that is no problem. Just in case I've drifted
into error, are there other limitations that I've missed?

Thanks Glyn

Sarah Bird

unread,
Dec 4, 2014, 2:49:00 PM12/4/14
to econsens...@googlegroups.com
Hi Glyn,

You need to understand South (http://south.readthedocs.org/en/latest/index.html).

South handles migrations for you.

Run through the tutorial (http://south.readthedocs.org/en/latest/tutorial/) and you should be all up to speed. The migrations are not manually created by us, they are auto-generated (although they may be manually tweaked for more complicated stuff).

Bird

--
You received this message because you are subscribed to the Google Groups "econsensusdiscuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to econsensusdisc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
sa...@aptivate.org
skype: birdsarah

Aptivate - Ethical IT for International Development
Aptivate | http://www.aptivate.org | Phone: +44 1223 967838
Citylife House, Sturton Street, Cambridge CB1 2QF

Aptivate is a not-for-profit company registered in England and Wales
with company number 04980791.



Reply all
Reply to author
Forward
0 new messages