pram
pram

Reputation: 1513

What is the use of models attribute in South SchemaMigration class?

In every generated migration files by South manage.py schemamigration, there usually will be a subclass of the south.v2.SchemaMigration. The class would contain forwards() and backwards() methods and also models attribute. How does South use the models attribute?

Upvotes: 2

Views: 198

Answers (1)

John
John

Reputation: 5206

This is called ORM freezing.

We also use a human-readable format that’s easy to change; since South relies on the frozen models not only for reacreating the ORM but also for detecting changes, it’s really useful to be able to edit them now and again (and also serves as a valuable debugging tool if you attach failing migrations to a ticket).

http://south.aeracode.org/docs/ormfreezing.html

Upvotes: 1

Related Questions