On Sun, 2009-03-22 at 14:37 -0700, Super McFly wrote:
> This is a bit of a tricky one but I need help solving the following
> error:
> 
> ImportError: cannot import name Container
> 
> I'm sure it has something to do with the unusual relationships I have
> between two models. I'll put a simplified version below.

You've got a circlar import going on. The containers/models.py file
needs to import the "Image" name from media/models.py, but in the course
of importing that latter file, it needs to import the "Container" name
from containers/models.py. However, containers/models.py hasn't been
imported properly yet by this point, so hilarity results.

The solutions isn't too hard, though. Use the "string format" for
referencing from, say, Image -> Container. See
http://docs.djangoproject.com/en/dev/ref/models/fields/#foreignkey for
documentation about this.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to