Conversation
|
The failing "Pallets Development Versions" check is due to a missing import in Werkzueg ( |
|
Looks like that fix should be made in Werkzeug @pgjones |
|
I think my original hesitation was that returning a dict is explicitly different from returning a database model. Returning a list of database results is probably something a lot more users will try. But I guess it's not that different to say they have to do |
|
I see. If they don't return a list of objects directly and call jsonify for the list, they will get the same error. Maybe we could update the docs to mention that the ORM/ODM object is not jsonify-able, they need to convert them to a dict or use a serialization library. |
|
Another potential confusion now that we support returning iterators/generators is that you're going to get very different results doing |
This adds support to serializing list return values to JSON, like what we did for the dictionary:
There are some discusses related to this feature in #3111, and the concern is the list return value looks too much like the tuple. Maybe we can rethink about this feature? I propose this because the following reasons:
[1, 2, 3]and(1, 2, 3), and people usually return tuple items without the bracket in the view function.If this change is acceptable, I will update the docs and changelog.
Sorry for break the "zero status". :P
Checklist:
CHANGES.rstsummarizing the change and linking to the issue... versionchanged::entries in any relevant code docs.pre-commithooks and fix any issues.pytestandtox, no tests failed.