Comments (5)
def page_href(self, page):
if self.href:
page = 1 if page is None else page
url = self.href.format(page)
else:
url = url_for(self.endpoint, page=page, **self.args)
# Need to return a unicode object
return url.decode('utf8') if PY2 else url
如果有多个参数的时候,这样子会出错,
def page_href(self, page):
page = 1 if page is None else page
if self.href:
url = self.href.format(page)
else:
url = url_for(self.endpoint, page=page, **self.args)
# Need to return a unicode object
return url.decode('utf8') if PY2 else url
这样子,就不会出错了,,,希望你再测试一下,
from flask-paginate.
Yes, you are right. But someone also needs the multi values url. The new release (0.2.8) tries to flat the params if non-multi values url used. Hope this can help you.
from flask-paginate.
Is the latest version fix the issue?
from flask-paginate.
Problem re-appears as soon as there is a multi value. I am trying to "flat" the keys. But it seems url_for, when encountering MultiDict, treats everything as a list.
from flask-paginate.
@MasterMind2k fixed the issue.
from flask-paginate.
Related Issues (20)
- [Regression] AttributeError: 'Pagination' object has no attribute 'bs_version' HOT 2
- Paginate shows all results on the same page. HOT 2
- How add custom href for links? HOT 1
- Implement Custom CSS Style
- Adding pagination breaks dynamic update of checkbox status HOT 1
- Page # in pagination blocks stays at 1 when two pagination blocks are used HOT 2
- css_framework='boostrap3' or css_framework=''bootsrap4' or css_framework='bootstrap' and bs_version=4 not working HOT 2
- flask >= 3, from flask import Markup broken HOT 4
- Missing rel attributes for links HOT 5
- did't show pagination.links HOT 1
- Please add an init parameter to control the url generation behavior for page 1 and prev_page HOT 4
- quote url value of href attribute for bulma css HOT 2
- There is an error in "app.cfg.example" where there is a missing "sign" after records. HOT 1
- Example: No such command 'init_db' HOT 3
- Translate text shown in {{ pagination.info }} HOT 2
- paginate in bootstrap / prev, next btn class HOT 3
- Missing tag for 2021.10.29 release HOT 1
- Does it only work for python Sql module? HOT 2
- TestPagination.test_defaults fails HOT 2
- Missing tag for 2021.12.28 release HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flask-paginate.