Opened 18 years ago

Closed 17 years ago

#2753 closed defect (duplicate)

Signals are picky about how senders are imported

Reported by: Joeboy Owned by: Adrian Holovaty
Component: Core (Other) Version: dev
Severity: normal Keywords: signal, signals, sender, senders, dispatcher
Cc: django25@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This works as expected:

from myproject.myapp import models as myapp_app
dispatcher.connect( myfunction, signal=signals.post_syncdb, sender=myapp_app)

This fails silently and mysteriously:

from myapp import models as myapp_app
dispatcher.connect( myfunction, signal=signals.post_syncdb, sender=myapp_app)

Thus decoupling is broken, and it takes the uninitiated user (ie. me) ages to work out what the problem is.

Change History (3)

comment:1 by Vinay Sajip <vinay_sajip@…>, 17 years ago

@Joe: Where did you put the above code?

comment:2 by Joeboy, 17 years ago

Vinay: in myproject/myapp/management.py

comment:3 by Malcolm Tredinnick, 17 years ago

Resolution: duplicate
Status: newclosed

This is a dupe of #3951 and the discussion over there explains the solution we'll implement.

Note: See TracTickets for help on using tickets.
Back to Top