Ejemplo n.º 1
0
def invalidate_m2m(sender=None, instance=None, model=None, action=None, pk_set=None, **kwargs):
    """
    Invoke invalidation on m2m changes.
    """
    if action in ('post_add', 'post_remove', 'post_clear'):
        invalidate_model(sender) # NOTE: this is harsh, but what's the alternative?
        invalidate_obj(instance)
Ejemplo n.º 2
0
def invalidate_m2m(sender=None, instance=None, model=None, action=None, pk_set=None, **kwargs):
    """
    Invoke invalidation on m2m changes.
    """
    if action in ("post_add", "post_remove", "post_clear"):
        invalidate_model(sender)  # NOTE: this is harsh, but what's the alternative?
        invalidate_obj(instance)
        # TODO: more granular invalidation for referenced models
        invalidate_model(model)
Ejemplo n.º 3
0
def invalidate_m2m(sender=None,
                   instance=None,
                   model=None,
                   action=None,
                   pk_set=None,
                   **kwargs):
    """
    Invoke invalidation on m2m changes.
    """
    if action in ('post_add', 'post_remove', 'post_clear'):
        invalidate_model(
            sender)  # NOTE: this is harsh, but what's the alternative?
        invalidate_obj(instance)