Hello

When displaying the query in a table, I want to display a custom
message if the result is empty.
For now I do this :

in my controller

elements=model.DBSession().query(model.Elements)

in my template

<p py:if="not elements.first()">The list is empty</p>
<table py:if="elements.first()">
 <tr><th>Name</th></tr>
 <tr py:for="elem in elements"><td>${elem.name}</td></tr>
</table>

but this generate 3 request to the SQL server !

Is it possible to avoid this ?

Regards

--
Alain Spineux                   |  aspineux gmail com
Your email 100% available |  http://www.emailgency.com
Send backup mail report    | http://www.magikmon.com/mkbackup


-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to