Skip to content Skip to sidebar Skip to footer

Inside For Loop If Condition Not Working In Django

http://localhost.com:8000/dashboard/track_info/13/ this page have the dropdown there user can select country. If user return to the same page.. here i want to display selected coun

Solution 1:

Writing up the solution in the comments -

Your country id is an integer 2, whereas your territory code is a string "2". That's why the equality test is not succeeding. You should cast your territory code to an integer (i.e., int(request.POST['territory_code']) ) before adding it to the session.

Post a Comment for "Inside For Loop If Condition Not Working In Django"