Well, it seems pretty clear from a few further tests that you can't import models at all from within a middleware.
Would be nice if that limitation was documented On Apr 16, 9:12 pm, anentropic <p...@blues.co.nz> wrote: > if it helps, my exclusive_boolean_fields function looks like: > > def exclusive_boolean_fields(model, eb_fields=[], with_fields=[]): > setattr(model, '_exclusive_boolean_fields', eb_fields) > setattr(model, '_exclusive_boolean_with_fields', with_fields) > post_save.connect(exclusive_boolean_handler, sender=model) > > ...so it's using a model signal. > > I can also import and use the middleware class just fine from the > shell. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group > athttp://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.