I have a template that has a button that posts just the button's name to a view which has the following code:
if request.POST:
a = request.POST
name = mymodel.objects.get(id = a )[0]
return HttpResponse(name)
request.POST has the name of the button that submitted the post. THE error is: int() argument must be a string or a number, not 'QueryDict'
However, when I do: a = request.POST['name]
, django raises a no 'name' in post error. How do I fix this?