“custom Python code in a historical context”
FMPOV, it means that your code will be run exactly at a certain
schema of your DB. If your migration is the 3rd one, it will
always be run after your first two migrations, thus you will
know exactly your schema.
The schema is passed to your function (as apps and schema_editor)
in order to get your Model class.
Sorry if my explanation wasn't clear, hope it will help at least.
On 03/02/2015 10:27 AM, Murthy Sandeep wrote:
> Hi
>
> thanks for the info.
>
> The docs also say that RunPython runs “custom Python code
> in a historical context”. What does that mean exactly? It seems
> related to the apps and schema_editor arguments passed to
> the custom method that will be called by RunPython - is this something
> like a snapshot of the app model that is stored when I do `python manage.py migrate`?
>
> Sandeep
>> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/54F42164.6040505%40arkade.info.