'WSGIRequest' object has no attribute 'Post'

نوار مكيس picture نوار مكيس · Nov 23, 2015 · Viewed 14.5k times · Source

I am new to django and python and I am trying to update the database boolean field from checkboxes in the html page. when I try to access the checkboxes in the views method, this error occurs: 'WSGIRequest' object has no attribute 'Post'

This is my code in the HTML:

This is the code in the views:

def update_existence(request):

   all_crosses = RaisingStatus.objects.all()

   if request.method == "POST":
       if ('exist' in request.POST):
           print('Post')  
           checks = request.Post['exist']
           # My desired processing here

   return render(request, 'lines/inventory.html', {'all_crosses' : all_crosses})

I also tried request.Post.getlist() and gave the same error

Answer

Raja Simon picture Raja Simon · Nov 23, 2015

Is that typo... It should be request.POST