You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use a subclass of Flask.json_encoder_class instead of _to_dict_include to handle which columns are included in JSON representation of database objects
#48
Closed
jfinkels opened this issue
Apr 9, 2012
· 2 comments
Once pallets/flask#471 is pulled into Flask (hopefully in Flask version 0.9), replace _to_dict and _to_dict_include in views.py with a custom subclass of Flask.JSONEncoder which checks which columns to include. This might be problematic because of the deep and exclude arguments of _to_dict.
The text was updated successfully, but these errors were encountered:
This really requires specifying a JSON encoder on a per-blueprint basis, which doesn't exist in Flask. We would have to change the JSON encoder for the entire Flask object, provided by the user, which may have unintended side effects in other parts of the user's code. Since it doesn't seem likely that per-blueprint error routing, request_class specification, or json_encoder specification will land in Flask any time soon, I'm going to close this as won't fix.
Once pallets/flask#471 is pulled into Flask (hopefully in Flask version 0.9), replace
_to_dict
and_to_dict_include
inviews.py
with a custom subclass ofFlask.JSONEncoder
which checks which columns to include. This might be problematic because of thedeep
andexclude
arguments of_to_dict
.The text was updated successfully, but these errors were encountered: