Extract common query parameters between search and list into slice.

        @param includes What metadata to return in results (e.g. charm-config).
        @param doc_type Filter to this type: bundle or charm.
        @param promulgated_only Whether to filter to only promulgated charms.
        @param sort Sorting the result based on the sort string provided
            which can be name, author, series and - in front for descending.
        @param owner Optional owner. If provided, search results will only
            include entities that owner can view.
        @param series The series to filter; can be a list of series or a
            single series.

def _common_query_parameters(self, doc_type, includes, owner,
                                 promulgated_only, series, sort):
        '''
        Extract common query parameters between search and list into slice.

        @param includes What metadata to return in results (e.g. charm-config).
        @param doc_type Filter to this type: bundle or charm.
        @param promulgated_only Whether to filter to only promulgated charms.
        @param sort Sorting the result based on the sort string provided
            which can be name, author, series and - in front for descending.
        @param owner Optional owner. If provided, search results will only
            include entities that owner can view.
        @param series The series to filter; can be a list of series or a
            single series.
        '''
        queries = []
        if includes is not None:
            queries.extend([('include', include) for include in includes])
        if doc_type is not None:
            queries.append(('type', doc_type))
        if promulgated_only:
            queries.append(('promulgated', 1))
        if owner is not None:
            queries.append(('owner', owner))
        if series is not None:
            if type(series) is list:
                series = ','.join(series)
            queries.append(('series', series))
        if sort is not None:
            queries.append(('sort', sort))
        return queries