By using this:
hotitems = Items.select(orderBy='shortname')
I receive some results, records count could be 0~N, and next step i
want the HTML rendering this results in a 4x4 grid, means no more than
first 16 item will display. And if less than 16 item, the rest will be
empty in HTML.
How is the most neat code to do this? Actually I have tried some but
not working or buggy...
Regards
David
Slicing?
<ul py:if="value[:4]" py:for="v in value[:4]">
<li py:content="v"/>
</ul>
<ul py:if="value[4:8]" py:for="v in value[4:8]">
<li py:content="v"/>
</ul>
...
and so on.
--
>> Diez B. Roggisch
>> Developer
T +49 (30) 443 50 99 - 27
F +49 (30) 443 50 99 - 99
M +49 (179) 11 75 303
E diez.r...@artnology.com
>> artnology GmbH
A Milastraße 4 / D-10437 Berlin
T +49 (30) 443 50 99 - 0
F +49 (30) 443 50 99 - 99
E in...@artnology.com
I http://www.artnology.com