def __init__(self, to, **kwargs):
        try:
            self.abstract_model = to._meta.object_name
        except __HOLE__:
            assert isinstance(to, six.string_types), "%s(%r) is invalid. First parameter must be either a model or a model name" % (self.__class__.__name__, to)
            self.abstract_model = to
        else:
            assert to._meta.abstract, "%s can only define a relation with abstract class %s" % (self.__class__.__name__, to._meta.object_name)
        self.options = kwargs
dataset/ETHPy150Open awesto/django-shop/shop/models/deferred.py/DeferredRelatedField.__init__