> I'd just say though that if you need the request and don't have it,
> it's often an indication that the program's structure is wrong.
I authored this change, and you are absolutely correct. This technique is
not ideal, but it is designed to stop several anti-patterns that happen
with great fr
Oh, nifty. And good docstring.
I'd just say though that if you need the request and don't have it,
it's often an indication that the program's structure is wrong.
Although there are certainly times when you need something like this,
such as when you call a third-party function that doesn't take a
It's in the cookiecutter's "get_tm_session" on the master branch. Which is not
the default branch.
The purpose of the pattern is if your model objects needed access to some
settings or some other request properties. It's up to you to decide if that's
good or bad. Of course you don't need to use
On Sat, Feb 20, 2021 at 12:57 PM Michael Merickel wrote:
> Check out the new pattern of storing the request in the SQLAlchemy session
> object for easier access in your model layer without threadlocals!
Where is that? I don't see it in 'pyramid-cookiecutter-starter' or the 2.0 docs.
I do essent
Pyramid 2.0b1 has been released.
- Fixes a circular reference / memory leak between request and context in some
apps.
- A bunch of documentation and cookiecutter improvements. Check out the new
pattern of storing the request in the SQLAlchemy session object for easier
access in your model laye