On Thursday 07 December 2006 16:33, David Xiao wrote: > Hello there, > > 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.
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 [EMAIL PROTECTED] >> artnology GmbH A Milastraße 4 / D-10437 Berlin T +49 (30) 443 50 99 - 0 F +49 (30) 443 50 99 - 99 E [EMAIL PROTECTED] I http://www.artnology.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

