On 2007-12-20 14:33:47 -0700, Julian <[EMAIL PROTECTED]> said:

> 
> hi there,
> 
> I do want to use pagination, but I don't know how to solve a problem.
> 
> template-code:
> 
> {% for p in paginator.page_range %}
> <a href="{% url my-view page=p %}">{{p}}</a>
> {% endfor %}
> 
> but obviously it should be:
> 
> {% for p in paginator.page_range %}
> <a href="{% url my-view page=p-1 %}">{{p}}</a>
> {% endfor %}

You need to write a templatetag to do this. Check out 
http://www.djangoproject.com/documentation/templates_python/#shortcut-for-simple-tags


because 

> in my-view I use the objectpaginator object zero-based, but
> page_range (for the template-output) is one-based.
> 
> this wouldn't be a problem if i could switch to 1-based object-
> pagination. so how do i dow? write my own object-pagionation-subclass?
> 
> 

-- 
Brian Rosner
http://oebfare.com



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to