<?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: Python: Decorators With Arguments (with bonus Django goodness)</title>
	<atom:link href="http://www.elfsternberg.com/2009/11/20/python-decorators-with-arguments-with-bonus-django-goodness/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.elfsternberg.com/2009/11/20/python-decorators-with-arguments-with-bonus-django-goodness/</link>
	<description>Done, and gets things smart.</description>
	<lastBuildDate>Fri, 03 Feb 2012 14:39:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Exploring Python @decorators &#124; Differential Progression</title>
		<link>http://www.elfsternberg.com/2009/11/20/python-decorators-with-arguments-with-bonus-django-goodness/comment-page-1/#comment-5674</link>
		<dc:creator>Exploring Python @decorators &#124; Differential Progression</dc:creator>
		<pubDate>Sat, 28 May 2011 17:02:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.elfsternberg.com/?p=503#comment-5674</guid>
		<description>[...] as usual, one goes off and does some research. My answer was found here in a very useful post by Elf Sternberg. The example on the linked page has a bit more detail than [...]</description>
		<content:encoded><![CDATA[<p>[...] as usual, one goes off and does some research. My answer was found here in a very useful post by Elf Sternberg. The example on the linked page has a bit more detail than [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeethu Rao</title>
		<link>http://www.elfsternberg.com/2009/11/20/python-decorators-with-arguments-with-bonus-django-goodness/comment-page-1/#comment-1290</link>
		<dc:creator>Jeethu Rao</dc:creator>
		<pubDate>Sat, 28 Nov 2009 12:03:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.elfsternberg.com/?p=503#comment-1290</guid>
		<description>Rob is right. How hard is it to check isinstance(r,HttpResponse) and return it directly ? I feel your argument about seperating the rendering and the business logic is just a strawman. Aren&#039;t properly written applications not supposed to be able to redirect ?</description>
		<content:encoded><![CDATA[<p>Rob is right. How hard is it to check isinstance(r,HttpResponse) and return it directly ? I feel your argument about seperating the rendering and the business logic is just a strawman. Aren&#8217;t properly written applications not supposed to be able to redirect ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elf Sternberg</title>
		<link>http://www.elfsternberg.com/2009/11/20/python-decorators-with-arguments-with-bonus-django-goodness/comment-page-1/#comment-952</link>
		<dc:creator>Elf Sternberg</dc:creator>
		<pubDate>Tue, 24 Nov 2009 16:18:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.elfsternberg.com/?p=503#comment-952</guid>
		<description>Rob, the point is that fn() isn&#039;t going to return an HttpResponseRedirect; the entire API is set up so that fn() returns a python dictionary (or dictionary-like; remember duck-typing) object, and the developer decorates that response with the appropriate handler.  This way, the rendering and the business logic are separate; the rule is simple: business modules return dictionaries of meaningful data, not the arbitrary bytestream of an HTML page.</description>
		<content:encoded><![CDATA[<p>Rob, the point is that fn() isn&#8217;t going to return an HttpResponseRedirect; the entire API is set up so that fn() returns a python dictionary (or dictionary-like; remember duck-typing) object, and the developer decorates that response with the appropriate handler.  This way, the rendering and the business logic are separate; the rule is simple: business modules return dictionaries of meaningful data, not the arbitrary bytestream of an HTML page.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob</title>
		<link>http://www.elfsternberg.com/2009/11/20/python-decorators-with-arguments-with-bonus-django-goodness/comment-page-1/#comment-908</link>
		<dc:creator>Rob</dc:creator>
		<pubDate>Sat, 21 Nov 2009 12:23:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.elfsternberg.com/?p=503#comment-908</guid>
		<description>You pass the results of fn() directly to render_to_response. If fn() returns a HttpResponseRedirect then you will get an error because render_to_response is expecting a dict as its second argument. Instead you should get the response of fn() and check to see if it is a response object; if it is then return it else pass it to render_to_response</description>
		<content:encoded><![CDATA[<p>You pass the results of fn() directly to render_to_response. If fn() returns a HttpResponseRedirect then you will get an error because render_to_response is expecting a dict as its second argument. Instead you should get the response of fn() and check to see if it is a response object; if it is then return it else pass it to render_to_response</p>
]]></content:encoded>
	</item>
</channel>
</rss>

