On Sep 14, 2007, at 1:50 PM, Matt Feifarek wrote:

Here's what I've got:

from paste.registry import StackedObjectProxy
_forms_storage_container = { }
registry = request.environ['paste.registry']
registry.register(StackedObjectProxy(), _forms_storage_container)

My hope was that _forms_storage_container would thereby do something *magic* to allow me to yank items from it for requests and to keep the data therein independent from other requests.

Is it perhaps deepcopy related?

The StackedObjectProxy is made once, at the module global level. The registry handles making sure that the instantiated proxy object points to the right object at the right time. So in your module's code you need:

#mymodule.py

myformobj = StackedObjectProxy(name="my form obj")


# in code used in your controller/middleware/whatever
registry = request.environ['paste.registry']
registry.register(mymodule.myformobj, _forms_storage_container)


Then in the rest of your code, you can import mymodule and use myformobj.

Cheers,
Ben

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to