So you have a page number thats getting passed from a url, right? and
then you want to display records based on that page number? you could
do something like this:
urls.py
(r'^page/(?P<page_number>\d+)/$', 'data.views.pagelisting'),
views.py
def pagelisting(request, page_number):
records = range(page_number + 10)
data_list = Data.objects.filter(pk=records)
return render_to_response('list.html', {"formset": formset})
template list.html
{% if formset %}
<ul>
{% for data in formset %}
<p>{{ data.text }}</p>
{% endfor %}
</ul>
{% else %}
<p>No data is available.</p>
{% endif %}
Might not be 100 percent on the code but i hope it helps.
Regards,
Devin Morin
I think this would work because you can see them using an array in
http://docs.djangoproject.com/en/dev/topics/db/queries/#the-pk-lookup-shortcut
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.