Does the Tornado python web framework have else statements in template?

I cannot figure out how to use if: else: statements in the Tornado template system...

I cannot find any examples online that show a pattern for else statements.

Does anyone know if this is possible?

asked 11 Nov '10, 19:21

Russell%20Ballestrini's gravatar image

Russell Ball...
1.3k232937
accept rate: 43%


i thought that it was something along the lines of

{% if _____ %}
    html code here
{% else %}
    html code here
{% end %}
link

answered 19 Nov '10, 17:40

swasheck's gravatar image

swasheck
8612
accept rate: 100%

1

Perfect thanks for the answer. That worked in my code

(29 Nov '10, 22:49) Russell Ball...
1

Thanks this code worked with me

(12 Jan '11, 09:18) Abdallah Rab...

this is a very interesting answer but I don't really know.

link

answered 30 Jan '11, 11:43

jaimeboyoyoing's gravatar image

jaimeboyoyoing
761
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×7
×1
×1
×1
×1

Asked: 11 Nov '10, 19:21

Seen: 2,943 times

Last updated: 30 Jan '11, 11:43

powered by OSQA