[webhelpers.paginate] I wonder why "_pagelink" and "_range" function are defined in "pager" function and not in "Page" class ?

2 views
Skip to first unread message

KLEIN Stéphane

unread,
Apr 11, 2009, 9:59:46 AM4/11/09
to pylons-devel
i,

In webhelpers.paginate module, I wonder why "_pagelink" and "_range"
function
are defined in "pager" function and not in "Page" class ?

Personnally, I need to override "_pagelink" function, with current
implementation I need to paste all "pager" function in my sub page
class.

Can I send to you a patch with "_pagelink" and "_range" function moved
to "Page"
class ?

Regards,
Stephane

Mike Orr

unread,
Apr 13, 2009, 1:44:20 PM4/13/09
to pylons...@googlegroups.com, Christoph Haas

Christoph Haas is Paginate's maintainer. You can send him a patch at
em...@christoph-haas.de . I don't know whether he has a particular
reason for putting those methods where they are.

--
Mike Orr <slugg...@gmail.com>

Mike Orr

unread,
Apr 13, 2009, 3:31:25 PM4/13/09
to pylons...@googlegroups.com, Christoph Haas
Christoph, I'm planning a WebHelpers release in a few days, so please
get back to me on whether you want to accept this idea.

--
Mike Orr <slugg...@gmail.com>

Christoph Haas

unread,
Apr 22, 2009, 6:11:33 PM4/22/09
to pylons...@googlegroups.com, KLEIN Stéphane
Hi, Stephane...

Please do that if you managed to do move the functions around. I understand
that you want to override the functions more easily but in the code it's
not that trivial. Page.pager() calls _range() which in turn calls
_pagerlink. And _pagerlink needs quite a few parameters from pager(). So
the correct way would be to pass through all these variables on every call.
I have started to do that but the code becomes less readable so that I
wonder if it's worth it.

Let me know if you have a niftier patch than what I did.

Cheers
Christoph

signature.asc

Christoph Haas

unread,
Apr 22, 2009, 6:13:59 PM4/22/09
to pylons...@googlegroups.com, KLEIN Stéphane

Sorry for the noise. Just found your patch at
http://paste.pocoo.org/show/113226/ and will look into it. Thanks for the
contribution.

Christoph

signature.asc
Reply all
Reply to author
Forward
0 new messages