Hi Anthony,
I think it is better to keep these if else (or for or while) statements
in separate lines for clarity. Otherwise, it is causing trouble... For
example. how would you interpret the statement below
This assumes the following logic :
if ... :
if . :
else:
>
> It gets very difficult to apply the if.. else statements in more complex
> situations inside the view html code if the basics are not clearly
> understood. So i really want to understand the exact new syntax of using
> the if... else... in view html files before i start using them more and
Hi Paolo, Roberto,
Thank you very much.
Paolo,
Your response helped me with the issue. Your option A) worked very
well!!. Thanks again... However your option B) gave incorrect result. Your
That is, it is thinking of the statement as follows:
if ... :
if . :
else
"else:" statement is inline with "if" statement.
the code wrapped in {{ }} follows python syntax rules.
Alternatives below should be work (not tested):
A) using ternary operator
B) inline syntax with multiple {{ }}
C) syntax not in line
Il giorno martedì 25 dicembre 2012 00:40:01 UTC+1,
4 matches
Mail list logo