user4079217
user4079217

Reputation:

argument of type 'instancemethod' is not iterable

Multiple check box in html, if None selected i want my user redirect to the same page.

Shall i do this via Javascript ? Or

if request.method == 'POST':
        if 'trackid' in request.POST.getlist and request.POST.getlist('trackid')!= "":
            new_check = request.POST.getlist('trackid')
        else:
            return redirect('app:frontview')

Oh.. i am getting this error argument of type 'instancemethod' is not iterable

Upvotes: 3

Views: 11982

Answers (1)

falsetru
falsetru

Reputation: 369344

You need to check membership of the key in the QueryDict, not in the method of the QueryDict.

The following line:

'trackid' in request.POST.getlist

should be replaced with:

'trackid' in request.POST

Upvotes: 2

Related Questions