def resolve(self):
    module, cls_name = self.class_name.rsplit('.', 1)
module = import_module(module)
cls = getattr(module, cls_name)
return cls.objects.get(pk=self.pk)
Django inheritance: how to have one method for all subclasses?