运行程序时,我收到以下错误消息
Caught TypeError while rendering: __init__() got an unexpected keyword
argument 'use_decimal'
这是我的密码 我正在使用jquery 1.6.4
def load_charts(chart_list=None, render_to=''):
embed_script = (
'<script type="text/javascript">\n'
'var _chartit_hco_array = %s;\n</script>\n'
'<script src="%s" type="text/javascript">\n</script>')
if chart_list is not None:
if isinstance(chart_list, (Chart, PivotChart)):
chart_list = [chart_list]
chart_list = [c.hcoptions for c in chart_list]
render_to_list = [s.strip() for s in render_to.split(',')]
for hco, render_to in izip_longest(chart_list, render_to_list):
if render_to:
hco['chart']['renderTo'] = render_to
embed_script = (embed_script % (simplejson.dumps(chart_list,
use_decimal=True),
CHART_LOADER_URL))
else:
embed_script = embed_script %((), CHART_LOADER_URL)
return mark_safe(embed_script)
为了拯救另一个灵魂,痛苦的时间花了。
注意:这应该在您的project virtual env中完成。
simplejson.dumps
的签名是(请参见documentation):如您所见,没有
use_decimal
参数。。。但你这样称呼它:编辑:事实上,更多的挖掘带来了this other documentation。似乎
use_decimal
参数是在simplejson库的某个版本中添加的。。。我建议您将库版本升级到最新版本!相关问题 更多 >
编程相关推荐