I am trying to transfer several models from one Django application to another and based on this question How do I transfer a model from one django application to a new one? Ive got this pretty much worked, but when creating the first migration Im getting this error:
"The model 'contenttype' from the app 'contenttypes' is not available in this migration."
Google and SO did not seem to find any cases for this, and the above question has nothing concrete to say about this other than a comment in the code:
if not db.dry_run:
It would be very helpful to understand what I am doing wrong.
Here are two migration files:
Create:
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): db.rename_table('cars_country', 'general_country') if not db.dry_run:
Delete
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): depends_on = ( ('general', '0002_create_country'), ) def forwards(self, orm): db.alter_column('cars_club', 'country_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['general.Country'], null=True)) def backwards(self, orm): db.rename_table('general_country', 'cars_country') db.alter_column('cars_club', 'country_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['cars.Country'], null=True))
source share