On 7/22/06, Maciej Bliziñski <[EMAIL PROTECTED]> wrote:
>
> The Django documentation refers to the pagination:
> http://www.djangoproject.com/documentation/generic_views/#notes-on-pagination
>
> And suggests following pagination scheme:
>
> ^objects/ -- object list, first page
> ^objects/page2/ -- second page
> ^objects/page3/ -- third page, and so on
>
> Let's say I'm creating pagination. I have designed the object list
> template, which has:
>
> {% if has_next %}
> <a href="page{{ next }}/">next</a>
> {% endif %}
>
> This template would link correctly from ^objects/ to ^objects/page2/.
> But unfortunately, it would link from ^objects/page2/ to
> ^objects/page2/page3/ (wrong).
>
> So if I wrote:
>
> {% if has_next %}
> <a href="../page{{ next }}/">next</a>
> {% endif %}
>
> It would link from ^objects/page2/ to ^objects/page3/ but unfortunately,
> it would also link from ^objects/ to ^/ (wrong).
>
> Which solution is best in your opinion?
>
>       * Absolute links? (I'm using them right now and was in trouble
>         already because of that)

I think it's the easiest solution.

>       * Redirect from ^objects/ to ^objects/page1/?
>       * Custom view for URL scheme ^objects/pageX/ that defines a
>         variable which indicates that ../ should be used?
>       * Other solution?
>
I ever using base tag in template, just like:

<html>
<head>
...
<base href="{% get_app_root "setting" %}/"/>

so all the relative link with based on base link. Maybe this would be helpful.

-- 
I like python!
My Blog: http://www.donews.net/limodou
My Django Site: http://www.djangocn.org
NewEdit Maillist: http://groups.google.com/group/NewEdit

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to