9👍
✅
When you call apps.get_model
in a migration, you don’t get the actual model class, you get a migration-specific class that is dynamically created with the fields present at that point in the migration history. It won’t have any of the methods of the real ContentType model.
You should probably just use apps.get_model
again to get the historical model for that content type:
model = apps.get_model(ct.app_label, ct.model)
Source:stackexchange.com