(self, can_access_all_locations, accessible_location_ids, show_all_data, show_project_data,
                    show_deactivated_data, selected_user_types, datespan, group_ids, location_ids, user_ids)
return case_filter
Return a list of `ExportFilter`s for the given ids.
        This list of filters will eventually be ANDed to filter the documents that appear in the export.
        Therefore, the filter will be constructed as such:
            (groups OR user type OR users OR locations) AND date filter AND accessible locations

        :param can_access_all_locations: if request user has full organization access permission
        :param accessible_location_ids: If not can_access_all_locations, this is a list of location ids that the
            user is restricted to seeing data from
        :return: list of filters
Return a list of `ExportFilter`s for the given ids.
        This list of filters will eventually be ANDed to filter the documents that appear in the export.
        Therefore, the filter will be constructed as such:
            (groups OR user type OR users OR locations) AND date filter AND accessible locations
Return a list of ExportFilter s for the given ids . This list of filters will eventually be ANDed to filter the documents that appear in the export . Therefore the filter will be constructed as such : ( groups OR user type OR users OR locations ) AND date filter AND accessible locations
def get_filters(self, can_access_all_locations, accessible_location_ids, show_all_data, show_project_data,
                    show_deactivated_data, selected_user_types, datespan, group_ids, location_ids, user_ids):
        """
        Return a list of `ExportFilter`s for the given ids.
        This list of filters will eventually be ANDed to filter the documents that appear in the export.
        Therefore, the filter will be constructed as such:
            (groups OR user type OR users OR locations) AND date filter AND accessible locations

        :param can_access_all_locations: if request user has full organization access permission
        :param accessible_location_ids: If not can_access_all_locations, this is a list of location ids that the
            user is restricted to seeing data from
        :return: list of filters
        """
        user_types = selected_user_types
        if can_access_all_locations and show_all_data:
            # if all data then just filter by date
            case_filter = []
        elif can_access_all_locations and show_project_data:
            # show projects data except user_ids for user types excluded
            ids_to_exclude = self.get_user_ids_for_user_types(
                admin=HQUserType.ADMIN not in user_types,
                unknown=HQUserType.UNKNOWN not in user_types,
                web=HQUserType.WEB in user_types,
                demo=HQUserType.DEMO_USER not in user_types,
                # this should be true since we are excluding
                commtrack=True,
            )
            case_filter = [NOT(OwnerFilter(ids_to_exclude))]
        elif can_access_all_locations and show_deactivated_data:
            # show projects data except user_ids for user types excluded
            ids_to_exclude = self.get_user_ids_for_user_types(
                admin=True,
                unknown=True,
                web=True,
                demo=True,
                commtrack=True,
                active=True,
                deactivated=False
            )
            case_filter = [NOT(OwnerFilter(ids_to_exclude))]
        else:
            case_filter = self._get_filters_from_slugs(
                can_access_all_locations, group_ids, selected_user_types, location_ids, user_ids
            )

        date_filter = self._get_datespan_filter(datespan)
        if date_filter:
            case_filter.append(date_filter)

        if not can_access_all_locations:
            case_filter.append(self._scope_filter(accessible_location_ids))

        return case_filter
def get_filters ( self , can_access_all_locations , accessible_location_ids , show_all_data , show_project_data , show_deactivated_data , selected_user_types , datespan , group_ids , location_ids , user_ids ) : user_types = selected_user_types if can_access_all_locations and show_all_data : # if all data then just filter by date case_filter = [ ] elif can_access_all_locations and show_project_data : # show projects data except user_ids for user types excluded ids_to_exclude = self . get_user_ids_for_user_types ( admin = HQUserType . ADMIN not in user_types , unknown = HQUserType . UNKNOWN not in user_types , web = HQUserType . WEB in user_types , demo = HQUserType . DEMO_USER not in user_types , # this should be true since we are excluding commtrack = True , ) case_filter = [ NOT ( OwnerFilter ( ids_to_exclude ) ) ] elif can_access_all_locations and show_deactivated_data : # show projects data except user_ids for user types excluded ids_to_exclude = self . get_user_ids_for_user_types ( admin = True , unknown = True , web = True , demo = True , commtrack = True , active = True , deactivated = False ) case_filter = [ NOT ( OwnerFilter ( ids_to_exclude ) ) ] else : case_filter = self . _get_filters_from_slugs ( can_access_all_locations , group_ids , selected_user_types , location_ids , user_ids ) date_filter = self . _get_datespan_filter ( datespan ) if date_filter : case_filter . append ( date_filter ) if not can_access_all_locations : case_filter . append ( self . _scope_filter ( accessible_location_ids ) ) return case_filter