Re: Django app and a submodule name conflict

2014-06-06 Thread Vahe Evoyan
Thanks Tom, Did something similar: added app/ directory as a module, so now all my imports look like app.A. On Thursday, June 5, 2014 5:12:53 PM UTC+4, Tom Evans wrote: > > On Wed, Jun 4, 2014 at 8:51 AM, Vahe Evoyan > wrote: > > I have modules in the project with the

Re: Django app and a submodule name conflict

2014-06-05 Thread Tom Evans
On Wed, Jun 4, 2014 at 8:51 AM, Vahe Evoyan wrote: > I have modules in the project with the same names, all placed in different > applications. > > Particularly there are two apps that conflict and result an ImportError. The > project structure approximately is as follows.

Re: Django app and a submodule name conflict

2014-06-04 Thread Vahe Evoyan
It currently works as you describe: "from .B.models import BModel", but I need it to work like "from ...B.models import BModel" to import apps/B/models.py module. The problem with "..." is that apps directory is not a module (i.e. there is no __init__.py file). The app directory is the first

Re: Django app and a submodule name conflict

2014-06-04 Thread Joseph Catrambone
It may be worth trying a relative import, depending on which version of Python you're using. I believe you can do "from .B.models import BModel". Note the '.' full-stop/period before the module. I can't promise that will fix your problem, as the layout isn't entirely clear to me, but it