Re: Djano if statement help

2012-03-16 Thread J. Cliff Dyer
Well the first suspicious thing was that you were testing to see if it was equal to the string "0". That tells me you don't understand how equality works in python. Python is strongly typed. Strings and integers are not the same thing, and will never be equal to one another. Without more informa

Re: Djano if statement help

2012-03-16 Thread HarryBoy
If I set it to "Enabled" and then check if it is indeed {% if EnableLogUpload == "Enabled" %} it does not enter the if statement. > > What am I doing wrong?? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web vi

Re: Djano if statement help

2012-03-16 Thread Joel Goldstick
On Fri, Mar 16, 2012 at 9:25 AM, HarryBoy wrote: >> Sorry the '==' was a typo, its actually: >> >> EnableLogUpload = "Enabled" > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.goog

Re: Djano if statement help

2012-03-16 Thread HarryBoy
Anyone? > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/dOBYPgDjwHcJ. To post to this group, send email to django-users@googlegroups.com. To uns

Re: Djano if statement help

2012-03-16 Thread HarryBoy
> > Sorry the '==' was a typo, its actually: > EnableLogUpload = "Enabled" > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/Tu0wfrtAPJUJ. To post to thi

Re: Djano if statement help

2012-03-16 Thread Tom Evans
On Fri, Mar 16, 2012 at 1:01 PM, HarryBoy wrote: >> Hi, thanks for the reply. > > > I printed the value and its actually 0 every time. > > Why is it 0 when I set it to EnableLogUpload == "Enabled"?? > > Thanks > '==' tests equality '=' assigns a rvalue Cheers Tom -- You received this message

Re: Djano if statement help

2012-03-16 Thread HarryBoy
> > Hi, thanks for the reply. I printed the value and its actually 0 every time. Why is it 0 when I set it to EnableLogUpload == "Enabled"?? Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit ht

Re: Djano if statement help

2012-03-16 Thread Joel Goldstick
On Fri, Mar 16, 2012 at 6:00 AM, HarryBoy wrote: > I have the following: > >               >                     name="EnableLogUpload" value="true"  {% if EnableLogUpload == '1' %} > checked="checked" {% endif %} />Enabled >                     name="EnableLogUpload" value="false" {% if EnableLo

Djano if statement help

2012-03-16 Thread HarryBoy
I have the following: Enabled Disabled Then the following if statement: {% if EnableLogUpload == '1' %} Enabled {% else %} Disabled {% endif %} The above code works as expected (If EnableLogUpload equals to true then 'Ena