Giter VIP home page Giter VIP logo

Comments (5)

sparksisnotspark avatar sparksisnotspark commented on May 28, 2024 1
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.

lixxu avatar lixxu commented on May 28, 2024

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.

lixxu avatar lixxu commented on May 28, 2024

Is the latest version fix the issue?

from flask-paginate.

MasterMind2k avatar MasterMind2k commented on May 28, 2024

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.

lixxu avatar lixxu commented on May 28, 2024

@MasterMind2k fixed the issue.

from flask-paginate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.