尝试设置对象列表时出现以下错误。我的数据没有这么早,但现在是了。
obj_list_dictize
处理这些问题的方法?
谢谢!
Module ckan.lib.dictization:79 in obj_list_dictize
>> obj, capacity = obj
ValueError: too many values to unpack
def obj_list_dictize(obj_list, context, sort_key=lambda x:x):
'''Get a list of model object and represent it as a list of dicts'''
result_list = []
active = context.get('active', True)
for obj in obj_list:
if context.get('with_capacity'):
obj, capacity = obj
dictized = table_dictize(obj, context, capacity=capacity)
else:
dictized = table_dictize(obj, context)
if active and obj.state != 'active':
continue
result_list.append(dictized)
return sorted(result_list, key=sort_key)