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

Allow methods to be included in response #203

Merged
merged 3 commits into from May 16, 2013
Merged

Allow methods to be included in response #203

merged 3 commits into from May 16, 2013

Conversation

logandk
Copy link
Contributor

@logandk logandk commented May 14, 2013

There are cases when the complexity of a method on a data model exceeds what is appropriate or possible using a hybrid property. I believe flask-restless should enable having this kind of logic on the model, by allowing return values of arbitrary methods to be included in the JSON response objects.

In this pull request, I have made the following changes:

Added an include_methods argument which allows embedding return values of methods into JSON response structures. Also, it serializes SQLAlchemy mapped objects returned from an included method.

…ues of methods into JSON response structures.

Also serialize SQLAlchemy mapped objects returned from an included
method.
@jfinkels
Copy link
Owner

This seems reasonable to me. I'll add a note in the documentation somewhere.

jfinkels added a commit that referenced this pull request May 16, 2013
Allow methods to be included in response
@jfinkels jfinkels merged commit 5702b4f into jfinkels:master May 16, 2013
jfinkels added a commit that referenced this pull request May 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants