extjs更新表格数据时出错,高手帮忙
前台是extjs 后台是django
错误如下:
RuntimeError: You called this URL via POST, but the URL doesn't end in a slash and you have APPEND_SLASH set. Django can't redirect to the slash URL while maintaining POST data. Change your form to point to localhost:8000/ums/download/downloadquery/ (note the trailing slash), or set APPEND_SLASH=False in your Django settings.
view.py代码如下:
def query(request):
page=Page()
start=request.REQUEST['start']
limite=request.REQUEST['limit']
v_downloadcode=request.REQUEST['downloadcode']
v_downloadname=request.REQUEST['downloadsname']
v_publishStart=request.REQUEST['publishStart']
v_publishEnd=request.REQUEST['publishEnd']
if limite==0:
limite=20
if v_downloadcode!=None:
queryList=SoftWare.objects.filter(id=v_downloadcode)
if v_downloadname!=None:
queryList=queryList.filter(name=v_downloadname)
queryList=queryList.filter(publishDate__gte=v_publishStart)
queryList=queryList.filter(publishDate__lte=v_publishEnd)
count=len(queryList)
queryList=queryList[start:limite]
else:
queryList=SoftWare.objects.filter(publishDate__gte=v_publishStart)
queryList=queryList.filter(publishDate__lte=v_publishEnd)
count=len(queryList)
queryList=queryList[start:limite]
else:
if v_downloadname!=None:
queryList=SoftWare.objects.filter(name=v_downloadname)
queryList=queryList.filter(publishDate__gte=v_publishStart)
queryList=queryList.filter(publishDate__lte=v_publishEnd)
count=len(queryList)
queryList=queryList[start:limite]
else:
queryList=SoftWare.objects.filter(publishDate__gte=v_publishStart)
queryList=queryList.filter(publishDate__lte=v_publishEnd)
count=len(queryList)
queryList=queryList[start:limite]
page.root=queryList
page.totalProperty=count
return HttpResponse(simplejson.dumps(page))