In your case I would monkeypatch the fields of MyModel while migrating:
from django.db.models.fields import DateTimeField from my_app.models import MyModel
def forwards(self, orm): for f in [f for f in MyModel._meta.fields if isinstance(f, DateTimeField)]: f.auto_now_add = False f.auto_now = False # Your data migration code here...
Comment
In your case I would monkeypatch the fields of MyModel while migrating:
from django.db.models.fields import DateTimeField
from my_app.models import MyModel
def forwards(self, orm):
for f in [f for f in MyModel._meta.fields if isinstance(f, DateTimeField)]:
f.auto_now_add = False
f.auto_now = False
# Your data migration code here...