<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Editing multiple objects in Django with forms</title>
	<atom:link href="http://collingrady.wordpress.com/2008/02/18/editing-multiple-objects-in-django-with-newforms/feed/" rel="self" type="application/rss+xml" />
	<link>http://collingrady.wordpress.com/2008/02/18/editing-multiple-objects-in-django-with-newforms/</link>
	<description></description>
	<lastBuildDate>Wed, 22 Apr 2009 23:25:28 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Lawrence Hudson</title>
		<link>http://collingrady.wordpress.com/2008/02/18/editing-multiple-objects-in-django-with-newforms/#comment-505</link>
		<dc:creator>Lawrence Hudson</dc:creator>
		<pubDate>Fri, 29 Feb 2008 16:20:27 +0000</pubDate>
		<guid isPermaLink="false">http://collingrady.com/2008/02/18/editing-multiple-objects-in-django-with-newforms/#comment-505</guid>
		<description>A very useful article for people (like me) coming over to Django from the &#039;other&#039; python web development framework.

Regarding the implementation of all(), reduce() would probably give slightly better performance than a python loop although I think that reduce() will not be present in python 3000 as a built-in.

If using a loop, the following is a slightly more efficient implementation than the one above (there is no point in continuing the iteration if an item is not True).

&lt;code&gt;
def all(items):
    for item in items:
        if not item:
            return False
    return True
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>A very useful article for people (like me) coming over to Django from the &#8216;other&#8217; python web development framework.</p>
<p>Regarding the implementation of all(), reduce() would probably give slightly better performance than a python loop although I think that reduce() will not be present in python 3000 as a built-in.</p>
<p>If using a loop, the following is a slightly more efficient implementation than the one above (there is no point in continuing the iteration if an item is not True).</p>
<p><code><br />
def all(items):<br />
    for item in items:<br />
        if not item:<br />
            return False<br />
    return True<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Collin</title>
		<link>http://collingrady.wordpress.com/2008/02/18/editing-multiple-objects-in-django-with-newforms/#comment-500</link>
		<dc:creator>Collin</dc:creator>
		<pubDate>Fri, 29 Feb 2008 00:00:10 +0000</pubDate>
		<guid isPermaLink="false">http://collingrady.com/2008/02/18/editing-multiple-objects-in-django-with-newforms/#comment-500</guid>
		<description>It&#039;s not so much that I dislike loops, I just like neat tricks like reduce ;)

The cast to bool is just playing it safe, though it might be redundant :)</description>
		<content:encoded><![CDATA[<p>It&#8217;s not so much that I dislike loops, I just like neat tricks like reduce <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>The cast to bool is just playing it safe, though it might be redundant <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Grant</title>
		<link>http://collingrady.wordpress.com/2008/02/18/editing-multiple-objects-in-django-with-newforms/#comment-501</link>
		<dc:creator>David Grant</dc:creator>
		<pubDate>Thu, 28 Feb 2008 23:20:22 +0000</pubDate>
		<guid isPermaLink="false">http://collingrady.com/2008/02/18/editing-multiple-objects-in-django-with-newforms/#comment-501</guid>
		<description>You really don&#039;t like writing loops do you? I find this much more readable

&lt;code&gt;
def all(items):
    result = True
    for item in items:
        result = result and item
    return result
&lt;/code&gt;

I like the use of list comprehensions is great though. What is explicit cast to bool for?

Great article, I was thinking of doing this for a project of mine as well.</description>
		<content:encoded><![CDATA[<p>You really don&#8217;t like writing loops do you? I find this much more readable</p>
<p><code><br />
def all(items):<br />
    result = True<br />
    for item in items:<br />
        result = result and item<br />
    return result<br />
</code></p>
<p>I like the use of list comprehensions is great though. What is explicit cast to bool for?</p>
<p>Great article, I was thinking of doing this for a project of mine as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yml</title>
		<link>http://collingrady.wordpress.com/2008/02/18/editing-multiple-objects-in-django-with-newforms/#comment-502</link>
		<dc:creator>yml</dc:creator>
		<pubDate>Tue, 26 Feb 2008 17:01:21 +0000</pubDate>
		<guid isPermaLink="false">http://collingrady.com/2008/02/18/editing-multiple-objects-in-django-with-newforms/#comment-502</guid>
		<description>Hello,
Thank you very much for this great recipe. This is one of the nicest and  shortest recipe to handle multiple objects with newforms.
Thank you
--ym</description>
		<content:encoded><![CDATA[<p>Hello,<br />
Thank you very much for this great recipe. This is one of the nicest and  shortest recipe to handle multiple objects with newforms.<br />
Thank you<br />
&#8211;ym</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Collin</title>
		<link>http://collingrady.wordpress.com/2008/02/18/editing-multiple-objects-in-django-with-newforms/#comment-503</link>
		<dc:creator>Collin</dc:creator>
		<pubDate>Tue, 19 Feb 2008 19:49:38 +0000</pubDate>
		<guid isPermaLink="false">http://collingrady.com/2008/02/18/editing-multiple-objects-in-django-with-newforms/#comment-503</guid>
		<description>Good catch on that prefix quirk, I&#039;ve adjusted the code with that fix :)</description>
		<content:encoded><![CDATA[<p>Good catch on that prefix quirk, I&#8217;ve adjusted the code with that fix <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Newman</title>
		<link>http://collingrady.wordpress.com/2008/02/18/editing-multiple-objects-in-django-with-newforms/#comment-504</link>
		<dc:creator>Michael Newman</dc:creator>
		<pubDate>Tue, 19 Feb 2008 14:20:51 +0000</pubDate>
		<guid isPermaLink="false">http://collingrady.com/2008/02/18/editing-multiple-objects-in-django-with-newforms/#comment-504</guid>
		<description>Thank you. That makes this unbelievable simple, but until you get your mind around it it really makes no sense. One thing I noticed it that when x=0 the prefix doesn&#039;t show up (prefix=0), which isn&#039;t a problem in this example, but if there is a field named the same in the base class it would be a conflict and also if you have bound information to the form, it could mess up the saving of that existing model. You can fix this easily enough by putting prefix=str(x). Thanks for posting this knowledge.</description>
		<content:encoded><![CDATA[<p>Thank you. That makes this unbelievable simple, but until you get your mind around it it really makes no sense. One thing I noticed it that when x=0 the prefix doesn&#8217;t show up (prefix=0), which isn&#8217;t a problem in this example, but if there is a field named the same in the base class it would be a conflict and also if you have bound information to the form, it could mess up the saving of that existing model. You can fix this easily enough by putting prefix=str(x). Thanks for posting this knowledge.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
