Example #1
0
    def set_filter_columns(self, search_filter, columns):
        if not ISearchFilter.providedBy(search_filter):
            pass
            # raise TypeError("search_filter must implement ISearchFilter")

        assert not search_filter in self._columns
        self._columns[search_filter] = columns
Example #2
0
    def set_filter_columns(self, search_filter, columns):
        if not ISearchFilter.providedBy(search_filter):
            pass
            #raise TypeError("search_filter must implement ISearchFilter")

        assert not search_filter in self._columns
        self._columns[search_filter] = columns
Example #3
0
    def add_filter_query_callback(self, search_filter, callback):
        """
        Adds a query callback for the filter search_filter

        @param search_filter: a search filter
        @param callback: a callable
        """
        if not ISearchFilter.providedBy(search_filter):
            raise TypeError
        if not callable(callback):
            raise TypeError
        l = self._filter_query_callbacks.setdefault(search_filter, [])
        l.append(callback)
Example #4
0
    def add_filter_query_callback(self, search_filter, callback):
        """
        Adds a query callback for the filter search_filter

        @param search_filter: a search filter
        @param callback: a callable
        """
        if not ISearchFilter.providedBy(search_filter):
            raise TypeError
        if not callable(callback):
            raise TypeError
        l = self._filter_query_callbacks.setdefault(search_filter, [])
        l.append(callback)
Example #5
0
    def set_filter_columns(self, search_filter, columns):
        """Set what columns should be filtered for the search_filter

        :param columns: Should be a list of column names or properties to be
          used in the query. If they are column names (strings), we will call
          getattr on the table to get the property for the query construction.
        """
        if not ISearchFilter.providedBy(search_filter):
            pass
            # raise TypeError("search_filter must implement ISearchFilter")

        assert not search_filter in self._columns
        self._columns[search_filter] = columns