def get_context(self):
        model = self.__class__.model
        if not isinstance(model, ModelBase):
            raise InlineAttributeError('ModelInline requires model to be set to a django model class')
        try:
            value = int(self.value)
            object = model.objects.get(pk=value)
        except ValueError:
            raise InlineInputError("'%s' could not be converted to an int" % self.value)
        except model.DoesNotExist:
            raise InlineInputError("'%s' could not be found in %s.%s" % (self.value, model._meta.app_label, model._meta.module_name))
        return { 'object': object }
dataset/ETHPy150Open mintchaos/django_inlines/django_inlines/inlines.py/ModelInline.get_context/original