[Chicago] Import question
Cosmin Stejerean
cosmin at offbytwo.com
Tue Dec 23 02:31:49 CET 2008
Looks like a circular dependency. Obj depends on db, but db depends on
obj. You need to find a way to break this circular dependency so that
both modules can be initialized.
Cosmin Stejerean(m)
On Dec 22, 2008, at 6:58 PM, "Daniel Griffin" <dgriff1 at gmail.com> wrote:
> I am having a problem with imports. I have 2 files, 1 which sets up
> SQLAlchemy and maps the object and the other which imports the first
> so that it can get a database connection.
>
> Example
> file obj
>
> import db
> class obj:
>
>
> file db
> from obj import obj
> mapper(obj....)
> Session() = scoped_session()
>
> python
> from obj import obj
> can't find obj
>
> I hope this makes sense, its twisting my brain around. Does anyone
> know what I am doing wrong?
>
> Thanks
>
>
>
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> http://mail.python.org/mailman/listinfo/chicago
More information about the Chicago
mailing list