Giter Club home page Giter Club logo

Comments (1)

crast avatar crast commented on May 11, 2024

There's nothing special about valuelist, it's just a plain list of strings.
There's no order retained in ._formdata, as you know, sets don't retain ordering.
The ._formdata is an internal value that you're not supposed to use, that's why it's prefixed with an underscore. If you want to get the form data as it was sent in-order, you can use .raw_data on the field.
In accessing the data property it iterates the query in the order the query is returned and then builds a list which then has the same ordering consistent with the order in which the query is returned. Having _formdata be a set just increases the speed of the comparisons to be O(1) for the purpose it's used for.

P.S. Please don't re-post closed tickets. I closed your original ticket #53 because you made assumptions based on a limited understanding of the code and if you had actually tested the QuerySelectField, you'd find that the thing you were requesting to happen was already the case. If you could provide concrete proof that the data property does not provide consistent ordering with the query, that's a valid basis, but we already have tests that prove it does work.

from wtforms.

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.