Ejemplo n.º 1
0
def m2m_changed_handler(sender, instance, **kwargs):
    """
    A bit different than the four signals above, since
    the m2m_changed signal looks a bit different.
    """
    model_with_m2m_relation = instance.__class__
    if _is_monitored(model_with_m2m_relation):
        handlers.db_handler(model_with_m2m_relation,
                            instance,
                            intermediate_model=sender,
                            other_end_model=kwargs['model'],
                            signal_name=kwargs['action'],
                            **kwargs)
Ejemplo n.º 2
0
def post_delete_handler(sender, instance, **kwargs):
    if _is_monitored(sender):
        kwargs.update(signal_name='post_delete')
        handlers.db_handler(sender, instance, **kwargs)
Ejemplo n.º 3
0
def pre_save_handler(sender, instance, **kwargs):
    if _is_monitored(sender):
        kwargs.update(signal_name='pre_save')
        handlers.db_handler(sender, instance, **kwargs)