for detail. I import Solrpy package to use. As for the document on Django project to introduce the pagenator. I pass the pagenator.page (Solrpage) object to tornado template but it doesn't work. I can'd use any method of Solrpage. instead it is rendered as a memory address.
below is the way to use the paginator , which is also the way I use
from django.core.paginator import Paginator, InvalidPage, EmptyPage
def listing(request): contact_list = Contacts.objects.all() paginator = Paginator(contact_list, 25) # Show 25 contacts per page
# Make sure page request is an int. If not, deliver first page.
try:
page = int(request.GET.get('page', '1'))
except ValueError:
page = 1
# If page request (9999) is out of range, deliver last page of results.
try:
contacts = paginator.page(page)
except (EmptyPage, InvalidPage):
contacts = paginator.page(paginator.num_pages)
return render_to_response('list.html', {"contacts": contacts})
{% for contact in contacts.object_list %}
{# Each "contact" is a Contact model object. #}
{{ contact.full_name|upper }}
...
{% endfor %}