I have a south datamigration that is trying to create new objects based on data found in other models. When trying to create a new object for the given 'destination' model I keep getting:
Cannot assign "<ContentType: ContentType object>": "Publishing.content_type" must be a "ContentType" instance.
It seems that there is something wrong with the 'instance' when accessed via the South freeze ORM, e.g.:
ContentType = orm['contenttypes.ContentType']
content_type_kwargs = {
'model': ContentModel._meta.module_name,
'app_label': ContentModel._meta.app_label, }
content_type = ContentType.objects.get(**content_type_kwargs)
# further down
publishing_kwargs = {
'site': Site.objects.get_current(),
'publishing_type': publishing_type,
'start': start,
'content_type': content_type,
'object_id': content_object.id, }
publishing = orm.Publishing(**publishing_kwargs) # Produces the error above
Now I've verified many times that the content_type
is in fact an instance of ContentType -- yet somehow django doesn't think so.
- Is there a difference between the 'freezed', south orm version of the instance and the native django one?
- What else might this possibly be?