My assumption is that the correct request object is not the guaranteed result, but I would like to know exactly why it’s ill advised, and the recommended way is to pass the request object down the pipeline from a view function.
My assumption is that the correct request object is not the guaranteed result, but
Share
After the request object has gotten to the view it’s recommended that you do not pass “as-is” to any non-web-specific code. Any code dealing with databases, etc shouldn’t be coupled to pyramid’s concept of a request. This pattern is easier to follow in Pyramid as it avoids a global request object.
The request object encompasses everything about why your view is being invoked, and making more code than necessary coupled to that object will cause you to write functions further down the pipeline that perhaps do “too much”.