<div dir="ltr">Thank you, now it seems working fine.<div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-05-10 14:47 GMT+02:00 Andrea D'Amore <span dir="ltr"><<a href="mailto:and.damore@gmail.com" target="_blank">and.damore@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 9 May 2016 at 22:06, Lorenzo Mainardi <<a href="mailto:lormayna@gmail.com">lormayna@gmail.com</a>> wrote:<br>
> You can find the code here:<br>
> <a href="https://bitbucket.org/lormayna/digi_task" rel="noreferrer" target="_blank">https://bitbucket.org/lormayna/digi_task</a><br>
<br>
> This is print dir(models): ['__builtins__', '__doc__', '__file__',<br>
> '__name__', '__package__']<br>
> This is print models.__file__:<br>
> /home/lorenzo/projects/digitel_task/app/models.pyc<br>
<br>
</span>I don't understand exactly what the issue is but I think it's a<br>
circular dependency one between app and models modules: app.py is<br>
importing from models.py that is importing from app.<br>
If you put print dir(models) just under "import models" in app.py you<br>
can see in the output that it's run twice, the first time the module<br>
has no attributes, and that's where you're getting the runtime error.<br>
The second time the models module is correctly showing the classes you<br>
defined, and that's the one you get if you try the code in an<br>
interactive interpreter and then try to manually execute<br>
admin.add_view() with models.Status, at that point models module is<br>
populated.<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
Andrea<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">LORENZO MAINARDI<br><a href="http://blog.mainardi.me" target="_blank">http://blog.mainardi.me</a><br></div>
</div>