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 render to access status code #938

Merged
merged 3 commits into from
Jun 1, 2020
Merged

Conversation

walt-w
Copy link
Contributor

@walt-w walt-w commented May 9, 2020

Minor change the sequence for init status and body, so render can access status code

Minor change the sequence for init status and body, so render can access status code
@tomchristie
Copy link
Member

Could you include an example of how you're using this?

I'm not convinced sure if moving the self.body = ... would be an improvement. It feels a bit like relying too much on internal implementation details. Also if we did move it, then we might instead want to move it further down, to just before the .init_headers call.

@walt-w
Copy link
Contributor Author

walt-w commented May 20, 2020

Sorry for slow response. For example, I want the render to response like {"status": 404, "message": "not found"} automatically for kinds of status code, for now I can only pass the whole response dict manually.
For move it before the .init_headers, it's a good idea.
So all the question is, should render be able to access Response properties ?

@walt-w
Copy link
Contributor Author

walt-w commented Jun 1, 2020

I've updated to move the render just before .init_headers

Copy link
Member

@tomchristie tomchristie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'm okay with this.

@tomchristie tomchristie merged commit 519f575 into encode:master Jun 1, 2020
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.

2 participants