2014-02-26 8:33 GMT+01:00 Russell Keith-Magee <russ...@keith-magee.com>:
> Is there some feature of the new app loading code that I can exploit here? Unfortunately not. One of the main differences between Arthur Koziel's GSoC and what I committed is that I removed the "reload()" feature for the app cache. That feature would have solved your problem. It was implemented by removing models modules from sys.modules and re-importing them. Since imports can have side effects in Python, and considering the amount of pain duplicate imports have caused before Carl fixed the projet layout, I didn't want to reimport modules. I wasn't comfortable with hacking sys.modules either because smart hacks tend to backfire. I've been thinking about creating a copy of auth.Group tied to EmailUser -- which would just mean executing of copy of the definition of the Group model while AUTH_USER_MODEL points to EmailUser -- and injecting it into the app registry by abusing private APIs. But that would require a copy of auth.Permission and any related model, recursively, which is impractical. You could hack into auth.Group internals to remove and recreate its relations, but that's hardly setting a good precedent. The current implementation of the ORM assumes that your models don't change at runtime and I'm not sure you can work around that sustainably. -- Aymeric. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CANE-7mUvJqEkQ_Oe2DTxU_Wt_ZqdVA4iOSXg4NxaqbowOVe0Qw%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.