<?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: Splitting up Django models</title>
	<atom:link href="http://www.nomadjourney.com/2009/11/splitting-up-django-models/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nomadjourney.com/2009/11/splitting-up-django-models/</link>
	<description>Django, Python, jQuery and whatever cool stuff I can think of</description>
	<lastBuildDate>Tue, 10 Aug 2010 17:27:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Sebastien</title>
		<link>http://www.nomadjourney.com/2009/11/splitting-up-django-models/comment-page-1/#comment-413</link>
		<dc:creator>Sebastien</dc:creator>
		<pubDate>Thu, 29 Apr 2010 11:15:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.nomadjourney.com/?p=301#comment-413</guid>
		<description>Hi !
I did what you said (thanks by the way, because it was -until recently- very useful!), but when I try to dynamically import some models, I got something strange...
Take a look a my code (which is in &lt;strong&gt;myapp.logger.__init__.py&lt;/strong&gt;) :
&lt;code&gt;
from django.conf import settings

    for log_hook in settings.LOG_HOOKS :
        try :
        __import__(log_hook)
    except ImportError as e :
        pass
#from myapp.logger.hooks.vmm import *
&lt;/code&gt;

Now, the problem is that when I try to import dynamically, I got some import errors, while if I directly write exactly the same import statement as the one generated, everything goes well...

Any idea to make this dynamic import work would be greatly welcome !!!</description>
		<content:encoded><![CDATA[<p>Hi !<br />
I did what you said (thanks by the way, because it was -until recently- very useful!), but when I try to dynamically import some models, I got something strange&#8230;<br />
Take a look a my code (which is in <strong>myapp.logger.__init__.py</strong>) :<br />
<code><br />
from django.conf import settings</p>
<p>    for log_hook in settings.LOG_HOOKS :<br />
        try :<br />
        __import__(log_hook)<br />
    except ImportError as e :<br />
        pass<br />
#from myapp.logger.hooks.vmm import *<br />
</code></p>
<p>Now, the problem is that when I try to import dynamically, I got some import errors, while if I directly write exactly the same import statement as the one generated, everything goes well&#8230;</p>
<p>Any idea to make this dynamic import work would be greatly welcome !!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Holloway</title>
		<link>http://www.nomadjourney.com/2009/11/splitting-up-django-models/comment-page-1/#comment-409</link>
		<dc:creator>Thomas Holloway</dc:creator>
		<pubDate>Thu, 08 Apr 2010 02:50:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.nomadjourney.com/?p=301#comment-409</guid>
		<description>I couldn&#039;t get it to work until I revised my &lt;code&gt;__init__.py&lt;/code&gt; to simply:

&lt;code&gt;
from foo import Foo
from bar import Bar
&lt;/code&gt;

This works and makes sense since you don&#039;t need to specify the full namespace from the top level.</description>
		<content:encoded><![CDATA[<p>I couldn&#8217;t get it to work until I revised my <code>__init__.py</code> to simply:</p>
<p><code><br />
from foo import Foo<br />
from bar import Bar<br />
</code></p>
<p>This works and makes sense since you don&#8217;t need to specify the full namespace from the top level.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Quinn</title>
		<link>http://www.nomadjourney.com/2009/11/splitting-up-django-models/comment-page-1/#comment-397</link>
		<dc:creator>Daniel Quinn</dc:creator>
		<pubDate>Tue, 19 Jan 2010 01:20:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.nomadjourney.com/?p=301#comment-397</guid>
		<description>This is one of those things that should really be part of the official documentation.  I really wish that I&#039;d found this 3hours ago rather than tinkering and surfing for all that time :-(

Great post though btw.</description>
		<content:encoded><![CDATA[<p>This is one of those things that should really be part of the official documentation.  I really wish that I&#8217;d found this 3hours ago rather than tinkering and surfing for all that time :-(</p>
<p>Great post though btw.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ezequiel Bertti</title>
		<link>http://www.nomadjourney.com/2009/11/splitting-up-django-models/comment-page-1/#comment-382</link>
		<dc:creator>Ezequiel Bertti</dc:creator>
		<pubDate>Sat, 12 Dec 2009 22:56:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.nomadjourney.com/?p=301#comment-382</guid>
		<description>This is the best &quot;HOW TO&quot; to make split models file in django!!! thanks!!!</description>
		<content:encoded><![CDATA[<p>This is the best &#8220;HOW TO&#8221; to make split models file in django!!! thanks!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nizam</title>
		<link>http://www.nomadjourney.com/2009/11/splitting-up-django-models/comment-page-1/#comment-312</link>
		<dc:creator>Nizam</dc:creator>
		<pubDate>Tue, 01 Dec 2009 17:10:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.nomadjourney.com/?p=301#comment-312</guid>
		<description>Yup, you are absolutely right. I have added a note at the end:

&lt;blockquote&gt;NOTE: One thing to note about ForeignKey relationships is that the import order in __init__.py is very important. Since Bar has a ForeignKey to Foo, Foo must be imported before Bar.&lt;/blockquote&gt;</description>
		<content:encoded><![CDATA[<p>Yup, you are absolutely right. I have added a note at the end:</p>
<blockquote><p>NOTE: One thing to note about ForeignKey relationships is that the import order in __init__.py is very important. Since Bar has a ForeignKey to Foo, Foo must be imported before Bar.</p></blockquote>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dumb F</title>
		<link>http://www.nomadjourney.com/2009/11/splitting-up-django-models/comment-page-1/#comment-310</link>
		<dc:creator>Dumb F</dc:creator>
		<pubDate>Tue, 01 Dec 2009 15:27:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.nomadjourney.com/?p=301#comment-310</guid>
		<description>Thanks a lot for taking note of my earlier comment.

In the article where it says  &quot;You’ll also need to explicitly import each model class in the model module’s __init__.py file&quot;, am I right in saying that the models would need to be imported in the proper order for syncdb etc to work right?</description>
		<content:encoded><![CDATA[<p>Thanks a lot for taking note of my earlier comment.</p>
<p>In the article where it says  &#8220;You’ll also need to explicitly import each model class in the model module’s __init__.py file&#8221;, am I right in saying that the models would need to be imported in the proper order for syncdb etc to work right?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nizam</title>
		<link>http://www.nomadjourney.com/2009/11/splitting-up-django-models/comment-page-1/#comment-290</link>
		<dc:creator>Nizam</dc:creator>
		<pubDate>Sun, 29 Nov 2009 16:18:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.nomadjourney.com/?p=301#comment-290</guid>
		<description>Sure thing. I just added that in as part of the example. Thanks.</description>
		<content:encoded><![CDATA[<p>Sure thing. I just added that in as part of the example. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dumb F</title>
		<link>http://www.nomadjourney.com/2009/11/splitting-up-django-models/comment-page-1/#comment-289</link>
		<dc:creator>Dumb F</dc:creator>
		<pubDate>Sun, 29 Nov 2009 13:42:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.nomadjourney.com/?p=301#comment-289</guid>
		<description>N00b here. Could you make one of your models have a foreign key to the other one? That would make a more complete guide for us n00bs.

Thanks.</description>
		<content:encoded><![CDATA[<p>N00b here. Could you make one of your models have a foreign key to the other one? That would make a more complete guide for us n00bs.</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nizam</title>
		<link>http://www.nomadjourney.com/2009/11/splitting-up-django-models/comment-page-1/#comment-273</link>
		<dc:creator>Nizam</dc:creator>
		<pubDate>Fri, 27 Nov 2009 03:06:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.nomadjourney.com/?p=301#comment-273</guid>
		<description>Pedro,

Thanks for your comment. All this time, I was putting my fixtures under the /models sub-directory. I thought it was a Django feature and it turns out to be a bug. :)</description>
		<content:encoded><![CDATA[<p>Pedro,</p>
<p>Thanks for your comment. All this time, I was putting my fixtures under the /models sub-directory. I thought it was a Django feature and it turns out to be a bug. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pedro Costa</title>
		<link>http://www.nomadjourney.com/2009/11/splitting-up-django-models/comment-page-1/#comment-271</link>
		<dc:creator>Pedro Costa</dc:creator>
		<pubDate>Thu, 26 Nov 2009 22:23:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.nomadjourney.com/?p=301#comment-271</guid>
		<description>This would be great but has problems with fixtures:

http://code.djangoproject.com/ticket/6961

I saw here: http://justinlilly.com/blog/2009/oct/27/fix-your-models-subdir/
how to solve this problem and it works!!</description>
		<content:encoded><![CDATA[<p>This would be great but has problems with fixtures:</p>
<p><a href="http://code.djangoproject.com/ticket/6961" rel="nofollow">http://code.djangoproject.com/ticket/6961</a></p>
<p>I saw here: <a href="http://justinlilly.com/blog/2009/oct/27/fix-your-models-subdir/" rel="nofollow">http://justinlilly.com/blog/2009/oct/27/fix-your-models-subdir/</a><br />
how to solve this problem and it works!!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
