예제 #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)
예제 #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)
예제 #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)