46👍
✅
You can’t use methods from models.py in south migrations. The reason is that in the future models.py will evolve and sooner or later you will delete those methods, then migration will be broken.
You should put all code needed by migration in migration file itself.
7👍
Here’s the pertinent section of the South docs explaining why your methods don’t work:
- [Django]-Override default get_absolute_url on User objects?
- [Django]-Getting 'str' object has no attribute 'get' in Django
- [Django]-Securing communication [Authenticity, Privacy & Integrity] with mobile app?
- [Django]-How to aggregate (min/max etc.) over Django JSONField data?
- [Django]-Django: list all reverse relations of a model
- [Django]-Django admin foreign key field data add
Source:stackexchange.com