Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Comments

@jfinkels
Copy link
Owner

jfinkels commented Apr 9, 2012

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.

@jfinkels
Copy link
Owner Author

jfinkels commented Sep 3, 2012

Looks like we may have to wait until Flask 0.10?

@jfinkels
Copy link
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant