尝试将我的TastyPie应用程序升级到Django 1.8,但收到错误消息:
Content type for specified type 'html' not found. Please provide it at either the class level or via the arguments.
在以下Python代码中执行serializer=...
时会发生这种情况:
class PeopleResource(ModelResource):
movie = fields.ToManyField('movies.api.MovieResource', 'movie', related_name="casts", null=True)
class Meta:
queryset = People.objects.all()
resource_name = 'people'
include_resource_uri = False
always_return_data = True
authorization= Authorization()
serializer = Serializer(formats=['json', 'jsonp', 'xml', 'yaml', 'html', 'plist'])
filtering = {
'name': ALL,
'id': ALL,
}
我不理解在类级或参数级提供的指令)。你知道吗
从docs:
默认序列化程序支持以下格式:
相关问题 更多 >
编程相关推荐