On 16/10/2014 7:11 AM, Ken Winter wrote:
>
> 4. Inspect a DB schema and modify the Django model set so that they
> match completely. Much harder, because it involves (a) comparing every
> detail of each existing model with the DB schema, (b) altering and
> deleting models as well as just creating them, and (c) dealing with the
> problems that these alterations and deletions may cause for existing app
> code. The last point in particular is a big hurdle. So level 4
> functionality may not be worth the effort
Why not do it the other way around? Use inspectdb to produce the new
models.py and just move the interesting code by hand from the original
models.py.
I agree it seems a lot of effort for a one-time exercise.
I once wrote a script to split a monolithic models.py into multiple .py
files in a models dir and it took a lot of effort for a one-time
exercise which in hindsight wasn't worth it.
ymmv
Mike