def _simplify_permissions(self, queryset):
        queryset = queryset.exclude(content_type__app_label__in=[
            ct for ct in PERMISSIONS_EXCLUDE if not isinstance(
                ct, (tuple, list)
            )
        ])
        for value in PERMISSIONS_EXCLUDE:
            if isinstance(value, (tuple, list)):
                app_label, model_name = value
                queryset = queryset.exclude(
                    content_type__app_label=app_label,
                    content_type__model=model_name
                )
        queryset = queryset.select_related('content_type').order_by(
            'content_type__model'
        )
        return queryset
Called when the data trait is changed.
dataset/ETHPy150Open allegro/ralph/src/ralph/accounts/admin.py/EditPermissionsFormMixin._simplify_permissions--crossover with--dataset/ETHPy150Open enthought/pyface/pyface/ui/wx/grid/composite_grid_model.py/CompositeGridModel._data_changed