Opened 11 years ago

Closed 11 years ago

#4407 closed (worksforme)

Sitemaps documentation should mention dispatchers

Reported by: orestis@… Owned by: nobody
Component: Documentation Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


In the sitemap documentation there is a suggestion that a good place to call ping_google() is in a models save method. This should be changed to mention dispatchers, as it is far more "correct" to connect to the post_save signal to ping google, instead of doing so in save_methods.


from django.db.models import signals
from django.dispatch import dispatcher
def ping(sender, args, kwargs):
    except Exception:

dispatcher.connect(ping, sender=Entry, signal=signals.post_save)

Change History (1)

comment:1 Changed 11 years ago by James Bennett

Resolution: worksforme
Status: newclosed

If a specific model is supposed to ping whenever it changes, then the model is the object that should "know" about this; hence the model is the correct location for the method.

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