Python imports from crossreferencing packages
<p>Currently I'm trying to write my first Python library and I've encountered the following problem:</p>

<p>I have the following import in my package myapp.factories:</p>

<pre><code>from myapp.models import *
</code></pre>

<p>And the following in my package myapp.models:</p>

<pre><code>from myapp.factories import *
</code></pre>

<p>I need the models in my factories package but inside one model I also need one of the factories. If I now call the code that needs the factory I get the following error:</p>

<pre><code>NameError: global name 'MyModelFactory' is not defined
</code></pre>

<p>I'm pretty sure it has something to do with the order in which the scripts are loaded but I can't seem to figure out how to get these crossreferences to work.</p>
