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

Replace req, resp, meta, params, kwargs, etc. with more general context parameter that can store all of this information #2

Closed
swistakm opened this issue Jul 2, 2015 · 2 comments

Comments

@swistakm
Copy link
Owner

swistakm commented Jul 2, 2015

This is an enchancement that will surely break compatibility but it will be a solution to problem with deciding which method should have access to which of this basic data structures.

Because there is always single resource instance on given route no state can be stored in this object between method calls. This means that all required data must be always passed to each method that requires it. Because of that graceful needs to make very opinionated decision about what is available on each step of processing the request. Although this helps developer to focus on what is important in specific method handler (e.g., retrieve, list, create in generic views) it is very hard to extend if something non usual needs to be done - often it requires overriding of many methods.

We could also consider if this context could be passed to serialisers so more complex things could be done like: field serialisation that depends on query string parameters.

@swistakm swistakm added this to the 1.0.0 milestone Jul 2, 2015
@swistakm
Copy link
Owner Author

swistakm commented Nov 8, 2016

I was thinking about this issue and it generally boils down to two overlapping problems:

  1. No easy way to create custom per-request context (Problem: No easy way to create custom per-request context #32)
  2. Incompatibility of generic APIs with falcon hooks (Problem: incompatibility with falcon hooks #31)

I have created two separate issues to track design ideas and problem descriptions.

@swistakm
Copy link
Owner Author

We have support for custom contexts so there is no need for that anymore.

@swistakm swistakm removed this from the 1.0.0 milestone Apr 11, 2017
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