

def render(self, context):
    if (self.page_number_variable is None):
        default_number = self.page_number
    else:
        default_number = int(self.page_number_variable.resolve(context))
    if (self.per_page_variable is None):
        per_page = self.per_page
    else:
        per_page = int(self.per_page_variable.resolve(context))
    if (self.first_page_variable is None):
        first_page = (self.first_page or per_page)
    else:
        first_page = int(self.first_page_variable.resolve(context))
    if (self.querystring_key_variable is None):
        querystring_key = self.querystring_key
    else:
        querystring_key = self.querystring_key_variable.resolve(context)
    if (self.override_path_variable is None):
        override_path = self.override_path
    else:
        override_path = self.override_path_variable.resolve(context)
    objects = self.objects.resolve(context)
    paginator = self.paginator(objects, per_page, first_page=first_page, orphans=settings.ORPHANS)
    if (default_number < 0):
        default_number = utils.normalize_page_number(default_number, paginator.page_range)
    page_number = utils.get_page_number_from_request(context['request'], querystring_key, default=default_number)
    try:
        page = paginator.page(page_number)
    except EmptyPage:
        page = paginator.page(1)
    data = {
        'default_number': default_number,
        'override_path': override_path,
        'page': page,
        'querystring_key': querystring_key,
    }
    context.update({
        'endless': data,
        self.var_name: page.object_list,
    })
    return ''

dataset/ETHPy150Open frankban/django-endless-pagination/endless_pagination/templatetags/endless.py PaginateNode.render/original