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 view create Response object #22

Closed
wants to merge 4 commits into from
Closed

Conversation

xen
Copy link

@xen xen commented Nov 7, 2018

Allow view to create custom Response object.

@xen
Copy link
Author

xen commented Nov 7, 2018

Another approach can be support for second value in return with code value. Like this:

@blp.response(code=204):
def delete(self, pet_id):
    pet = Pet.get_by_id(pet_id)
    if pet is None:
        return None, 404
    Pet.delete(pet_id)

But one that I've implemented gives more flexibility.

@lafrech
Copy link
Member

lafrech commented Nov 9, 2018

Thanks. I intend to do something like this.

I'd like to address #18 at the same time.

Basically, allow Blueprint.response to receive either a response and headers, or just a response, and the response could be just a payload or a Response object.

I just need to get my head around this.

@lafrech
Copy link
Member

lafrech commented Feb 24, 2019

@xen, I just sent another PR implementing this (#40). Feedback welcome.

@lafrech lafrech closed this in #40 Mar 5, 2019
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