On Thu, Jun 21, 2007 at 11:04:40PM -0000, Rob Hudson wrote: > > Just following up... > > If you use the query string option, you don't need to know the current > url, you can just do this: > > {% if has_previous %} > <a href="?page={{ previous }}">Previous</a> > {% endif %}
Which works fine & dandy as long as you're not using GET parameters for anything else. The canonical example is a search page with paginated results. It's actually a slight pain to come up with a good way to construct the prev/next URLs without making too many assumptions about the order/presence of GET parameters. I'd be happy if django would come up with a nice solution to that problem. I'd also be happier if django's pagination template context parameters didn't pollute the template context so much. It'd be nice to stuff them all in a dict called paginator: {{paginator.next}} etc. But idunno, I guess it's not that big of a deal. In practical terms, it probably doesn't actually come up, since you can just avoid name conflicts by not naming your context variables the same as the pagination variables. -Forest
signature.asc
Description: Digital signature