Sunday, October 9, 2011

Re: Question about Signals and Bootstrap

On 2011-10-08, at 7:36 AM, Santiago Basulto wrote:
> Where can i find some doc that explains how Django is bootstraped and
> loaded. I'm looking for this becouse while i was reading the "Signals"
> chapter at django docs, i read that "In some circumstances, the module
> in which you are connecting signals may be imported multiple times."
> This looks weird, and it's confusing me. So, before asking "where
> should i put my signals code not to duplicate it?" i ask for the
> django workflow.

There is no real guarantee on your import order. So relax, don't worry about it. Instead give each signal a unique dispatch_uid:

https://docs.djangoproject.com/en/dev/topics/signals/#preventing-duplicate-signals

This makes disconnecting signals easier as well.
--
Andy McKay
andy@clearwind.ca
twitter: @andymckay

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

No comments:

Post a Comment