On Sun, Dec 19, 2010 at 5:55 AM, dmitry b <[email protected]> wrote: > On Dec 18, 1:44 am, Łukasz Rekucki <[email protected]> wrote: >>[...]The problem with putting signal handlers >> in __init__, is that it isn't the place you would really expect Model >> related code to live (like post_save). It can also lead to non-obvious >> cyclic imports, 'cause your handler code will most likely need some >> models, etc. > > Cyclic imports is exactly the problem I've run into. I do currently > keep the signal handler registration code in __init__.py because that > the only place as far as I can tell is guaranteed to be executed at > Django's initialization. But because of cyclic dependencies, I had to > move all other code out of __init__.py. Sounds like Django needs an > init.py for every app that will be executed after all imports are > done.
This is something that is planned for 1.4, as a consequence of the App-refactor work that Arthur Koziel did for the GSoC this year. See #3591 for details. Yours, Russ Magee %-) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected]. 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.

