[Solved]-How to access model's class level variable in data migration?

5👍

You should be able to import the model

from my_app.models import Poll

If you do this, you shouldn’t delete the Poll model or the MY_VAR attribute, otherwise your migrations will stop working.

0👍

I think you can’t access model method in migration.
I found the answer here How to call a static methods on a django model class during a south migration

Leave a comment