On Sep 10, 7:16 am, nbv4 <cp368...@ohio.edu> wrote: > I remember reading about away to use django models without importing, > but google fails me. I want to create a ForeignKey relation to another > model, but I can't import it because that will call an endless loop of > imports. > > I know about doing: > > field = models.ForeignKey("app.Model") > > but theres a bug in django (at least there was last time I ran into > it) that causes a showstopper error in mod_wsgi. So thats out of the > question.
I use this all the time, including in production with mod_wsgi, and have never encountered an error with it. Can you point me to the bug? > > I remember it being something like: > > from django.utils import get_model > Model = get_model("app", "model") That works, except it's in django.db.models not django.utils. -- DR. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---