Generic views and pagination links

12 views
Skip to first unread message

Gnissem

unread,
Aug 26, 2006, 2:00:11 AM8/26/06
to Django users
I am using generic views to produce a paginated specimen list. In the
list, you can click on a specimen to get the generic view detail.
After viewing the detail, the user will likely want to go back to the
specimen list, on the page where the link came from. Pressing the back
button works, but I'd like to give the user a link to take them back.
How do I go this?

I tried passing the page number from the generic list view into the
generic detail view with a url like: /specimen/244/?page=7. However
there does not seem to be any way to access GET data in the template.
Since there is no view, it can't be retrieved there and passed to the
template. (And in general it seems like it would be nice to pass GET
values directly into a template without needing the intervention of a
view. Is this possible?

Thanks in advance for help. I am new to Django so excuse me if I have
missed something obvious....

hugh4life

unread,
Aug 26, 2006, 8:30:18 AM8/26/06
to Django users

You need to wrap the generic detail view with your own detail view
which passes the specific GET variable you need through the
"extra_context" dictionary.

Reply all
Reply to author
Forward
0 new messages