def archive_year(request, year, searchqueryset=None, date_field='pub_date', template_name='tumbleweed/tumble_archive_year.html', **kwargs):
    """
    A paginated list of tumbled item for a given year.
    
    Required parameters:
    
        year
            The year to tumble, usually passed in as part of the URL.
    
    Optional parameters:
    
        date_field
            The name of the field in your `haystack`_ index that you would like to order
            your tumbles by.  Default: ``pub_date``.
        
        template_name
            The name of the template to render.  Default: :template:`tumbleweed/tumble.html`.
        
        searchqueryset
            You may pass in your own SearchQuerySet_ if you would like to further restrict
            what items show up in the tumble view.  This is useful for filtering only live
            objects or only objects whose publication date has passed.  Default: ``None``.
        
        paginate_by
            The number of objects to include in each page of the tumble.  Default:
            ``TUMBLEWEED_RESULTS_PER_PAGE`` in your settings file, or 20.
        
        context_class
            Pass in your own `context class`_.  Default: Django's ``RequestContext``.
        
        extra_context
            A dictionary containing extra variables to be included in the context, similar
            to ``extra_context`` included in Django's generic views.
        
    Template context:

        page
            The current page of haystack results.
        
        paginator
            The Paginator_ for access to information about the paginated list
            for creating next/previous links, showing the total number of
            tumbled items, etc.
    
    .. _haystack: http://haystacksearch.org/
    .. _SearchQuerySet: http://haystacksearch.org/docs/searchqueryset_api.html
    .. _context class: http://docs.djangoproject.com/en/dev/ref/templates/api/#id1
    .. _Paginator: http://docs.djangoproject.com/en/dev/topics/pagination/
    """
    if not searchqueryset:
        searchqueryset = SearchQuerySet().all()

    try:
        year = int(year)
    except ValueError:
        return HttpResponseServerError(u'An integer is required for year.')

    # TODO: Less ugly, please.
    lookup_kwargs = {
        date_field % '%s__gte': datetime.datetime(year, 1, 1),
        '%s__lte' % date_field: datetime.datetime(year, 12, 31, 23, 59, 59)
    }
    return tumble(request, searchqueryset=searchqueryset.filter(**lookup_kwargs), template_name=template_name, **kwargs)
dataset/ETHPy150Open mcroydon/django-tumbleweed/tumbleweed/views.py/archive_year/swapped operands of `%`