Changes between Version 4 and Version 5 of Tutorial2
- Timestamp:
- 07/14/09 21:43:09 (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Tutorial2
v4 v5 31 31 Now you understand the caveats, it's time to try it out. We'll take the same app we used for [wiki:Tutorial1 part one]. 32 32 33 If you didn't have that set when you made the initial migration previously, don't worry; just delete that migration file, and re-run the command: 33 Have another look at the migration file (`southdemo/migrations/0001_initial.py`) - there is a large models dictionary on the bottom; if you look closely, it is a representation of how your models are at the moment. It's using this stored representation that allows South to see how your models change over time. 34 34 35 {{{ 36 ./manage.py startmigration southdemo --initial 37 }}} 38 39 The migration file (`southdemo/migrations/0001_initial.py`) should still have the same forwards() and backwards() methods, but now there will be a much larger models dictionary on the bottom; if you look closely, it is a representation of how your models are at the moment. 40 41 Once you have that file made, we'll change the models we have slightly; we'll add a field `length` to Lizard, and allow the age to be left blank (and become null if it is): 35 To illustrate this, we'll make a change; we'll add a field `length` to Lizard, and allow the age to be left blank (and become null if it is): 42 36 43 37 {{{
