def METHOD_NAME(cls, sender, document, **kwargs):
    if 'post_save' in kwargs.get('ignores', []):
        return
    cls.after_save.send(document)
    if kwargs.get('created'):
        cls.on_create.send(document)
    else:
        cls.on_update.send(document)
    if document.deleted:
        cls.on_delete.send(document)