Re: Best way to present N items in table row for list

2010-07-30 Thread Wadim
On 29 июл, 12:08, Roald de Vries wrote: > First: list is a very unlucky name for a parameter, since it's the   > type of [] > > Second: list comprehension rules! > >      def groupListByRow(list): >          return [lst[start:start+5] for start in range(0, len(lst), 5)] > > Cheers, Roald Perfect

Best way to present N items in table row for list

2010-07-27 Thread Wadim
Hello. I have a list that i want to present in a table. Each row should have 5 items. For now i create the function that returns me new grouped list, that i use later in a template. def groupListByRow(list): cnt=0 rows=[] while cnthttp://groups.google.com/group/django-users?