Remember that Django is "just" Python under the hood and that Python,
like any other self-respecting language, will always treat different
types as being, well, different!
On Sep 29, 10:14 pm, aa56280 wrote:
> Thanks for that. I figured it was something along those lines. I
> didn't think Django
Thanks for that. I figured it was something along those lines. I
didn't think Django did a check on the type as well when evaluating
the expression, but apparently it does. Very interesting.
Thanks again.
On Sep 29, 2:46 pm, Yo-Yo Ma wrote:
> request.GET.get('subtopic') is returning a string,
request.GET.get('subtopic') is returning a string, so your if
statement is roughly equivalent to:
>>> 1 == '1'
False
The sub_topic = int(request.GET.get('subtopic')) is the correct way to
do that. At first glance it seems like a lot of work, but if Django
tried to deserialize URL params automatic
3 matches
Mail list logo