This is somewhat of a general Python question I guess, but I've only
noticed it when playing with Django.

I've got a class named 'Object' that resides on
myproject/apps/objects/models.py, this has some class methods that are
in another module located at myproject/functions_db.py. So I'm doing an
'import myproject.functions_db' from within the file "Object" resides
in.

Over in the functions_db.py file, I need access to the Object class. So
I'm doing a 'from myproject.apps.objects.models import Object'.

So the modules need to import one another, which I know is a problem in
some languages. I had the problem of functions_db.py not finding the
"Object" class when I imported as described. If I removed the import of
'functions_db' from the "Object" class file, functions_db had no
problem loading up the "Object" class.

Sorry if this is poorly explained, but how do you efficiently get
around circular dependency problems like this in Python? I'd hate to
have to drop my import of functions_db to the individual methods on
"Object" to avoid whatever collision is happening.

Thanks


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to