Hello, i'm a TurboGears newbie.
I'm trying TG under Ubuntu 17.04, i create a project using


gearbox quickstart HelloWorld
and after
python setup.py develop
done this with gearbox serve i have the default site that says "Welcome to 
TurboGears 2.3"

I'm not understanding why "py:choose" is not working.
I tried also in a page where Genshi templates are working, for example the 
default environ.xhtml
>From the controller function i pass a JSON value "result" = 1
These expressions are working correctly as expected ( i see the values 7 10 
printed, 1 instead of "Hello", "failed"; "passed" is not written in page):
        <div>
            <span py:with="y=7; z=10">$y $z</span>
        </div>        

        <ul>
        <li py:content="result">Hello</li>
        </ul>      

        <div>
        <b py:if="result == 1">failed</b>
        </div>        

        <div>
        <b py:if="result == 2">passed</b>
        </div> 

instead trying
        <div py:choose="result">
        <span py:when="0">0</span>
        <span py:when="1">1</span>
        <span py:otherwise="">2</span>
        </div>

        <py:choose test="1">
        <py:when test="0">0</py:when>
        <py:when test="1">1</py:when>
        <py:otherwise>2</py:otherwise>
        </py:choose>        
                
        <div py:choose="result">
            <span py:when='1'><h2>Result: Fail</h2></span>
            <span py:when='2'><h2>Result: Pass</h2></span>
        </div>

it writes 
0 1 2
0 1 2
Result: Fail
Result: Pass

instead of 
1
1
Result: Fail

as expected

If someone could help, thanks.


-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.

Reply via email to