<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Django template filter: Show list of objects as table with fixed number of columns</title>
	<atom:link href="http://pedroassuncao.com/2009/09/django-template-filter-show-list-of-objects-as-table-with-fixed-number-of-columns/feed/" rel="self" type="application/rss+xml" />
	<link>http://pedroassuncao.com/2009/09/django-template-filter-show-list-of-objects-as-table-with-fixed-number-of-columns/</link>
	<description>Thoughts on technology, skydiving, life, and the universe...</description>
	<lastBuildDate>Wed, 04 Jan 2012 17:34:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: nocivus</title>
		<link>http://pedroassuncao.com/2009/09/django-template-filter-show-list-of-objects-as-table-with-fixed-number-of-columns/comment-page-1/#comment-28353</link>
		<dc:creator>nocivus</dc:creator>
		<pubDate>Wed, 30 Nov 2011 15:51:03 +0000</pubDate>
		<guid isPermaLink="false">http://diffract.me/?p=414#comment-28353</guid>
		<description>Not sure i understand what you said. Can you explain it with a more explicit example? </description>
		<content:encoded><![CDATA[<p>Not sure i understand what you said. Can you explain it with a more explicit example?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Serge</title>
		<link>http://pedroassuncao.com/2009/09/django-template-filter-show-list-of-objects-as-table-with-fixed-number-of-columns/comment-page-1/#comment-28352</link>
		<dc:creator>Serge</dc:creator>
		<pubDate>Wed, 30 Nov 2011 15:46:10 +0000</pubDate>
		<guid isPermaLink="false">http://diffract.me/?p=414#comment-28352</guid>
		<description>As far as I understand the code, the table generated will render the list from left to right first and then from top to bottom. Often you need the opposite, especially if you have sorted data  - say, list of countries. Basically, you will want just one row in a table where the first column has the first chunk of the list and so on. </description>
		<content:encoded><![CDATA[<p>As far as I understand the code, the table generated will render the list from left to right first and then from top to bottom. Often you need the opposite, especially if you have sorted data  &#8211; say, list of countries. Basically, you will want just one row in a table where the first column has the first chunk of the list and so on.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nocivus</title>
		<link>http://pedroassuncao.com/2009/09/django-template-filter-show-list-of-objects-as-table-with-fixed-number-of-columns/comment-page-1/#comment-20241</link>
		<dc:creator>nocivus</dc:creator>
		<pubDate>Mon, 03 Oct 2011 14:27:03 +0000</pubDate>
		<guid isPermaLink="false">http://diffract.me/?p=414#comment-20241</guid>
		<description>Good to know :)                                    --Pedro Assunção&lt;p style=&quot;color: #A0A0A8;&quot;&gt; </description>
		<content:encoded><![CDATA[<p>Good to know <img src='http://pedroassuncao.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />                                     &#8211;Pedro Assunção&lt;p style=&#8221;color: #A0A0A8;&#8221;&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://pedroassuncao.com/2009/09/django-template-filter-show-list-of-objects-as-table-with-fixed-number-of-columns/comment-page-1/#comment-19679</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Fri, 30 Sep 2011 15:03:36 +0000</pubDate>
		<guid isPermaLink="false">http://diffract.me/?p=414#comment-19679</guid>
		<description>Nearly a year later, and I&#039;ve found this very useful, thank you :-) </description>
		<content:encoded><![CDATA[<p>Nearly a year later, and I&#039;ve found this very useful, thank you <img src='http://pedroassuncao.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ypocat</title>
		<link>http://pedroassuncao.com/2009/09/django-template-filter-show-list-of-objects-as-table-with-fixed-number-of-columns/comment-page-1/#comment-8006</link>
		<dc:creator>ypocat</dc:creator>
		<pubDate>Tue, 14 Dec 2010 17:13:07 +0000</pubDate>
		<guid isPermaLink="false">http://diffract.me/?p=414#comment-8006</guid>
		<description>i know, i just like to be a smartass, and i know you know that:) 
but python really allows to write basic data manipulation in 1/10th of the space of Java-like languages, and due to the smaller space taken, the code is then also better readable and manageable, at least in my view. 
the huge downside is that the compiler doesn&#039;t tell you much about broken code - you simply have to run all the branches to make sure.. which on the other hand is good because it forces you to test your code properly...  
anyway.. i&#039;ve switched from Google App Engine Java to Python some time ago, and never looked back since - but this may also be because of the GAE limitations - the stuff you can do there is usually quite simple, and Python is OK for that. </description>
		<content:encoded><![CDATA[<p>i know, i just like to be a smartass, and i know you know that:)<br />
but python really allows to write basic data manipulation in 1/10th of the space of Java-like languages, and due to the smaller space taken, the code is then also better readable and manageable, at least in my view.<br />
the huge downside is that the compiler doesn&#039;t tell you much about broken code &#8211; you simply have to run all the branches to make sure.. which on the other hand is good because it forces you to test your code properly&#8230;<br />
anyway.. i&#039;ve switched from Google App Engine Java to Python some time ago, and never looked back since &#8211; but this may also be because of the GAE limitations &#8211; the stuff you can do there is usually quite simple, and Python is OK for that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nocivus</title>
		<link>http://pedroassuncao.com/2009/09/django-template-filter-show-list-of-objects-as-table-with-fixed-number-of-columns/comment-page-1/#comment-7991</link>
		<dc:creator>nocivus</dc:creator>
		<pubDate>Tue, 14 Dec 2010 07:55:24 +0000</pubDate>
		<guid isPermaLink="false">http://diffract.me/?p=414#comment-7991</guid>
		<description>Thanks for the one liner. My main point was to express the creation of a template filter, but your solution for the filter implementation code is by far simpler :)  </description>
		<content:encoded><![CDATA[<p>Thanks for the one liner. My main point was to express the creation of a template filter, but your solution for the filter implementation code is by far simpler <img src='http://pedroassuncao.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ypocat</title>
		<link>http://pedroassuncao.com/2009/09/django-template-filter-show-list-of-objects-as-table-with-fixed-number-of-columns/comment-page-1/#comment-7990</link>
		<dc:creator>ypocat</dc:creator>
		<pubDate>Tue, 14 Dec 2010 06:16:59 +0000</pubDate>
		<guid isPermaLink="false">http://diffract.me/?p=414#comment-7990</guid>
		<description>rows = [ data[v:v+cols] for v in range(0,len(data),cols) ] 
 
fixed! :-) </description>
		<content:encoded><![CDATA[<p>rows = [ data[v:v+cols] for v in range(0,len(data),cols) ] </p>
<p>fixed! <img src='http://pedroassuncao.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nocivus</title>
		<link>http://pedroassuncao.com/2009/09/django-template-filter-show-list-of-objects-as-table-with-fixed-number-of-columns/comment-page-1/#comment-7913</link>
		<dc:creator>nocivus</dc:creator>
		<pubDate>Fri, 10 Dec 2010 20:07:51 +0000</pubDate>
		<guid isPermaLink="false">http://diffract.me/?p=414#comment-7913</guid>
		<description>I guess there are a number of ways of solving it :)  </description>
		<content:encoded><![CDATA[<p>I guess there are a number of ways of solving it <img src='http://pedroassuncao.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian</title>
		<link>http://pedroassuncao.com/2009/09/django-template-filter-show-list-of-objects-as-table-with-fixed-number-of-columns/comment-page-1/#comment-7909</link>
		<dc:creator>Christian</dc:creator>
		<pubDate>Fri, 10 Dec 2010 17:50:57 +0000</pubDate>
		<guid isPermaLink="false">http://diffract.me/?p=414#comment-7909</guid>
		<description>Perhaps by now there is a better way to do this, but I found it useful. Thanks. 
 
I want my tables to have the same number of columns on every row... 
 
 
    # Still stuff missing? 
# see how many are missing and add empty elements to complete the row 
    if len(row) &gt; 0: 
remaining = len(row) 
to_add = cols - remaining 
for c in range(to_add): 
row.append([]) 
 
rows.append(row) 
     
    return rows 
 </description>
		<content:encoded><![CDATA[<p>Perhaps by now there is a better way to do this, but I found it useful. Thanks. </p>
<p>I want my tables to have the same number of columns on every row&#8230; </p>
<p>    # Still stuff missing?<br />
# see how many are missing and add empty elements to complete the row<br />
    if len(row) &gt; 0:<br />
remaining = len(row)<br />
to_add = cols &#8211; remaining<br />
for c in range(to_add):<br />
row.append([]) </p>
<p>rows.append(row) </p>
<p>    return rows</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pedro Assuncao</title>
		<link>http://pedroassuncao.com/2009/09/django-template-filter-show-list-of-objects-as-table-with-fixed-number-of-columns/comment-page-1/#comment-3150</link>
		<dc:creator>Pedro Assuncao</dc:creator>
		<pubDate>Fri, 14 May 2010 06:16:16 +0000</pubDate>
		<guid isPermaLink="false">http://diffract.me/?p=414#comment-3150</guid>
		<description>No worries :)</description>
		<content:encoded><![CDATA[<p>No worries <img src='http://pedroassuncao.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

