On Sat, Sep 5, 2009 at 4:52 PM, Michael Ralan <mr5...@gmail.com> wrote:

>
> Hi,
>
> Apologies if this question has been asked before but I was not able to
> find a satisfactory answer.
>
> In the django admin app there is a capability to have a pagination
> object that lists the number of pages that can be paged.
>
> I have found code that uses the django Paginator object which builds a
> navbar that looks like this
>
>  previous    <Page 2 of 2>
>
> The documentation for the Paginator tag (seems to be non-native) on
> the django site shows what I want. But is an example that uses a
> custom template. This is also clearly a custom tag.
>
> How do I use the django admin navbar in my app? I want it to display
> something like
>
> [1] [2] [3] [...] [30]
>
> and do it natively.
>
>
I don't know what you mean by native and non-native.  Admin builds that list
of possible pages you can jump to using its own custom tag, the heart of the
code is here:


http://code.djangoproject.com/browser/django/tags/releases/1.1/django/contrib/admin/templatetags/admin_list.py#L28

The tags used by the admin are generally not documented for use by other
apps.  Thus there is no direct way to "paginate like admin", but the source
is freely available so you can certainly borrow it.

Karen

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to