-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define URL generator when instantiating Page #2
Comments
Hi Robert, yes, I was considering such a URL generation callback. My first priority So if you could provide a proper patch I'll merge it. Thanks. Kindly |
This makes it possible to specify a function to generate the URL for a page during instantiation instead of from the template. When used in a Pyramid project, this could serve as an example: def url_maker(page_number): return request.current_route_url(_query=dict(page=page_number)) Fixes Pylons#2
I'm all in favor of not sticking to one framework and keeping it free from the magic you removed in 99b590e. Pushed a patch to my fork. Thanks for offering to merge! |
Relating to my commit message. Until Pyramid solves Pylons/pyramid#1040, you'll have to write this as
|
We're currently shipping a fork of paginate in our product including this commit. Generally, I'd prefer not to derive from upstream too much. Can you give some general feedback on the patch's acceptability? What are the chances of seeing a merge / release? |
Sorry, I missed your commit. Thanks for the patch - I have merged it. Please next time consider sending a pull request. |
Defining the page_url from the template with the $page replacement protocol does not seem like the right place to us. It would be much more convenient, if we could alternatively provide a URL generation function during instantiation.
From an API side, this could be used as:
In Pyramid, a simple page maker could be
We are currently doing this in a Page subclass, but getting it upstream would be preferable. I can provide a pull request, but wanted to make sure this has a chance of getting accepted first.
The text was updated successfully, but these errors were encountered: