'Generates a MockModel class that provides enough information
to be used by a foreign key/many-to-many relationship.
Migrations should prefer to use these rather than actual models
as models could get deleted over time, but these can remain in
migration files forever.
Depreciated.'

def mock_model(self, model_name, db_table, db_tablespace='', pk_field_name='id', pk_field_type=models.AutoField, pk_field_args=[], pk_field_kwargs={}):

    class MockOptions(object, ):
        def __init__(self):
            self.db_table = db_table
            self.db_tablespace = (db_tablespace or settings.DEFAULT_TABLESPACE)
            self.object_name = model_name
            self.module_name = model_name.lower()
            if (pk_field_type == models.AutoField):
                pk_field_kwargs['primary_key'] = True
            self.pk = pk_field_type(*pk_field_args, **pk_field_kwargs)
            self.pk.set_attributes_from_name(pk_field_name)
            self.abstract = False
        def get_field_by_name(self, field_name):
            return (self.pk, self.model, True, False)
        def get_field(self, name):
            return self.pk
    class MockModel(object, ):
        _meta = None
    MockModel._meta = MockOptions()
    MockModel._meta.model = MockModel
    return MockModel
