def get_context(self, request, category, year=None, month=None, day=None):

        ella_data = category.app_data.ella

        no_home_listings = ella_data.no_home_listings

        # pagination
        page_no = None
        if 'p' in request.GET and request.GET['p'].isdigit():
            page_no = int(request.GET['p'])

        # if we are not on the first page, display a different template
        category_title_page = (page_no is None or (not no_home_listings and page_no == 1)) and not year

        if page_no is None:
            page_no = 1

        kwa = {'children': ella_data.child_behavior}

        if 'using' in request.GET:
            kwa['source'] = request.GET['using']
        else:
            kwa['source'] = ella_data.listing_handler

        if day:
            try:
                start_day = datetime(int(year), int(month), int(day))
                kwa['date_range'] = (start_day, start_day + timedelta(seconds=24 * 3600 - 1))
            except (ValueError, OverflowError):
                raise Http404(_('Invalid day value %r') % day)
        elif month:
            try:
                start_day = datetime(int(year), int(month), 1)
                kwa['date_range'] = (start_day, (start_day + timedelta(days=32)).replace(day=1) - timedelta(seconds=1))
            except (ValueError, OverflowError):
                raise Http404(_('Invalid month value %r') % month)
        elif year:
            try:
                start_day = datetime(int(year), 1, 1)
                kwa['date_range'] = (start_day, (start_day + timedelta(days=370)).replace(day=1) - timedelta(seconds=1))
            except (ValueError, OverflowError):
                raise Http404(_('Invalid year value %r') % year)

        if 'date_range' in kwa:
            kwa['date_range'] = tuple(map(localize, kwa['date_range']))

        # basic context
        context = {
            'category' : category,
            'is_homepage': category_title_page and not category.tree_parent_id,
            'is_title_page': category_title_page,
            'archive_entry_year' : lambda: self._archive_entry_year(category),
        }

        # no listings wanted on title page
        if category_title_page and no_home_listings:
            return context

        # add pagination
        page = ella_data.get_listings_page(page_no, **kwa)
        context.update({
            'is_paginated': page.has_other_pages(),
            'results_per_page': page.paginator.per_page,
            'page': page,
            'listings': page.object_list,
        })

        return context

# backwards compatibility
dataset/ETHPy150Open ella/ella/ella/core/views.py/ListContentType.get_context/original