kolibri/core/auth/signals.py
def cascade_delete_membership(sender, instance=None, *args, **kwargs):
    """
    For a given membership instance and the collection associated with it,
    we delete all membership objects whose collection is a child of the instance's collection.
    """
    Membership.objects.filter(
        collection__parent_id=instance.collection_id, user=instance.user
    ).delete()

    For a given membership instance and the collection associated with it,
    we delete all membership objects whose collection is a child of the instance's collection.
    
For a given membership instance and the collection associated with it,
we delete all membership objects whose collection is a child of the instance's collection.
For a given membership instance and the collection associated with it we delete all membership objects whose collection is a child of the instance ' s collection .
def cascade_delete_membership(sender, instance=None, *args, **kwargs):
    Membership.objects.filter(
        collection__parent_id=instance.collection_id, user=instance.user
    ).delete()
def cascade_delete_membership ( sender , instance = None , * args , ** kwargs ) : Membership . objects . filter ( collection__parent_id = instance . collection_id , user = instance . user ) . delete ( )
For a given membership instance and the collection associated with it,
we delete all membership objects whose collection is a child of the instance's collection.
For a given membership instance and the collection associated with it we delete all membership objects whose collection is a child of the instance ' s collection .
"""
    For a given membership instance and the collection associated with it,
    we delete all membership objects whose collection is a child of the instance's collection.
    """
sender
instance