Proposal: Generic Pagination

Visto 2 veces
Saltar al primer mensaje no leído

Iapain

no leída,
27 ago 2007, 4:40:4527/8/07
a Django developers
Introduction:

Most of the time ObjectionPaginator server incomplete functionality
because some one have to generate a page bar[<Prev 1 2 3 .. 10 11
12 .. 18 19 20 Next >] in template. However some a kind of template
tag would allow you to create a small tiny hack but not a generic one.
I just looked inside django.contrib.admin and I think it is fairly
possible and strongly believe Django should include it in its package.

Proposal:

To write a GenericPaginator class which should render page bar in
template if a template tag is encountered.

-It Should form querystring
-A decent Page bar
-Multiple Object support in a single template

Just open for your opinion, in case if it comes out to be useful then
I'll put a ticket on Trac.

Regards,
Deepak Thukral

Philipp Keller

no leída,
27 ago 2007, 4:48:5527/8/07
a django-d...@googlegroups.com
+1

I also looked into django.contrib.admin for that <Prev 1 2 3 .. 10 11 Next> thing and wanted to reuse the code there but ended in coding it myself.

greets
Philipp

oyvind....@gmail.com

no leída,
27 ago 2007, 17:36:3127/8/07
a Django developers

Paul Davis

no leída,
27 ago 2007, 18:17:4627/8/07
a django-d...@googlegroups.com

I extended a different snippet to do what I wanted. Posted it just now
at [1]. I do think that this needs to be looked at, for my first
django project, this was one of the major stumbling blocks for me.
(Which I think is about as good of an endorsement for django as any
other)

[1] http://www.djangosnippets.org/snippets/394/

Paul Davis

Iapain

no leída,
27 ago 2007, 19:01:1227/8/07
a Django developers
> http://www.djangosnippets.org/snippets/378/
Not really

> http://www.djangosnippets.org/snippets/394/
bit closer (should have used query string ?p=1 instead of /page/1)

But still I prefer the way django.contrib.admin is doing. The core
question is it should be included in django standard package? I
implemented one the way django.contrib.admin is doing. http://dpaste.com/17864/

Deepak

Paul Davis

no leída,
27 ago 2007, 19:32:4027/8/07
a django-d...@googlegroups.com
On 8/27/07, Iapain <iap...@gmail.com> wrote:
>
> > http://www.djangosnippets.org/snippets/378/
> Not really
>
> > http://www.djangosnippets.org/snippets/394/
> bit closer (should have used query string ?p=1 instead of /page/1)
>

I definitely wrestled with this. I ended up going without the query
string cause from the examples i saw it looked like the 'django way'
of doing things.

> But still I prefer the way django.contrib.admin is doing. The core
> question is it should be included in django standard package? I
> implemented one the way django.contrib.admin is doing. http://dpaste.com/17864/
>
> Deepak
>
>

And I vote yes to including a version similar to yours.

Paul Davis

Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos