@classmethod
def add_to_active_filters(cls, filter, key=None):
    """
        Add a new clause to the active filters. A filter may be either
        a Q object to be applied to the content class or a callable taking
        a queryset and spitting out a new one.

        If a filter with the given `key` already exists, the new filter
        replaces the old.
        """
    if cls.active_filters is None:
        cls.active_filters = {}
    if key is None:
        key = filter
    cls.active_filters[key] = filter
