我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用django.core.serializers.SerializerDoesNotExist()。
def create_serializer(cls, format): '''create instance of serializer from two classes''' try: FormatSerializerCls = serializers.get_serializer(format) except serializers.SerializerDoesNotExist: raise Exception("Unknown serialization format: %s" % format) SerializerCls = type('GitVersionSerializer', ( cls, FormatSerializerCls), {}) return SerializerCls()