<?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:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: How to split views.py into a directory (Django, Python)</title>
	<atom:link href="http://slacy.com/blog/2009/07/how-to-split-views-py-into-a-directory-django-python/feed/" rel="self" type="application/rss+xml" />
	<link>http://slacy.com/blog/2009/07/how-to-split-views-py-into-a-directory-django-python/</link>
	<description>This site is solar powered!</description>
	<lastBuildDate>Sat, 19 May 2012 03:18:15 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Rushabh</title>
		<link>http://slacy.com/blog/2009/07/how-to-split-views-py-into-a-directory-django-python/comment-page-1/#comment-17767</link>
		<dc:creator>Rushabh</dc:creator>
		<pubDate>Sun, 26 Jul 2009 02:09:04 +0000</pubDate>
		<guid isPermaLink="false">http://slacy.com/blog/?p=864#comment-17767</guid>
		<description>I started writing a comment and it got big enough to warrant its own post:
http://radoshi.blogspot.com/2009/07/geek-splitting-django-views.html

I don&#039;t think hacking __init__ is a good idea, I&#039;d rather hack the urls.py to point to the right thing.

Note that models should be *significantly* easier, because models is meant to be split and I don&#039;t think there are functions which expect the models.py to contain everything (other than admin views if you are using that).</description>
		<content:encoded><![CDATA[<p>I started writing a comment and it got big enough to warrant its own post:<br />
<a href="http://radoshi.blogspot.com/2009/07/geek-splitting-django-views.html" rel="nofollow">http://radoshi.blogspot.com/2009/07/geek-splitting-django-views.html</a></p>
<p>I don&#8217;t think hacking __init__ is a good idea, I&#8217;d rather hack the urls.py to point to the right thing.</p>
<p>Note that models should be *significantly* easier, because models is meant to be split and I don&#8217;t think there are functions which expect the models.py to contain everything (other than admin views if you are using that).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Schinckel</title>
		<link>http://slacy.com/blog/2009/07/how-to-split-views-py-into-a-directory-django-python/comment-page-1/#comment-17766</link>
		<dc:creator>Matthew Schinckel</dc:creator>
		<pubDate>Sat, 25 Jul 2009 03:15:31 +0000</pubDate>
		<guid isPermaLink="false">http://slacy.com/blog/?p=864#comment-17766</guid>
		<description>The content of my __init__.py for a directory where I want to import all of the files looks like:

names = [f[:-3] for f in os.listdir(__path__[0]) if (not f.startswith(&#039;_&#039;)) and f.endswith(&#039;.py&#039;)]
__all__ = []
for name in names:
    exec(&quot;from %s import *&quot; % name)
    exec(&quot;import %s&quot; % name)
    exec(&quot;__all__.extend(%s.__all__)&quot; % name)

(Those last three exec lines are all indented one level).

You could possibly remove the references to __all__, but I leave them in, and then in each file, only add the classes/functions I wan exported to __all__ in each of them.</description>
		<content:encoded><![CDATA[<p>The content of my __init__.py for a directory where I want to import all of the files looks like:</p>
<p>names = [f[:-3] for f in os.listdir(__path__[0]) if (not f.startswith(&#8216;_&#8217;)) and f.endswith(&#8216;.py&#8217;)]<br />
__all__ = []<br />
for name in names:<br />
    exec(&#8220;from %s import *&#8221; % name)<br />
    exec(&#8220;import %s&#8221; % name)<br />
    exec(&#8220;__all__.extend(%s.__all__)&#8221; % name)</p>
<p>(Those last three exec lines are all indented one level).</p>
<p>You could possibly remove the references to __all__, but I leave them in, and then in each file, only add the classes/functions I wan exported to __all__ in each of them.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

