On 31 January 2012 13:43, Robert Forkel <[email protected]> wrote: > fwiw: when I started using pyramid I was also reluctant to pass around > the request all the time. But it turned out to be the right (and > transparent) thing to do. In my case this is because I often need > request-specific information like the locale name basically > everywhere. Once you get used to this (and to creating DummyRequests > all the time for tests), you will come to like the registry as the > place to go for global settings.
Another option – in terms of "the right thing" – is to derive an object that carries just to things you need from the request, e.g. "locale" and "logged in user", so that you don't pass around an HTTP request everywhere (and hence need to stub it out in tests). That object might be an "environment" in which code executes. \malthe -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
