Conditionals

Note that the division showing the publication date is wrapped by a t element with the t-if attribute set. This attribute is evaluated as Python code, and the element is only rendered if the result is a truthy value. In the following example, we only show the div class if there is actually a publication date set. However, in complex cases, you can use t-elif and t-else as in the following example:

<div t-if="state == 'new'">
Text will be added of state is new.
</div>
<div t-elif="state == 'progress'">
Text will be added of state is progress.
</div>
<div t-else="">
Text will be added for all other stages.
</div>
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset