[英]Processing a django post request - one value getting assigned and other failes to assign dont know why
嘗試從html的簡單帖子。
當我在django中收到請求時,我只是打印后請求。 (計數未反映在我的輸出dunno y ..中)
print "counterUpdate"
print request.method
print request.path
print request.POST.get
print "Expects data of counts in next line console print but it is empty"
countValues=request.POST['counts'] # counts is not getting reflected in my output dunno y..
updateType=request.POST['key']
print countValues
print updateType
print "dddd1"
for data in request.POST:
print data
print "Iteration Over"
列出以下內容:
counterUpdate
POST
/testapp/counterUpdate
<bound method QueryDict.get of <QueryDict: {u'counts': [u'100', u'100', u'', u''], u'key': [u'increase']}>>
Expects data of counts in next line console print but it is empty
increase
dddd1
counts
key
Iteration Over
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.