Hi All,

I'm writing a SQLAlchemy SessionExtension based on this pattern:

http://www.sqlalchemy.org/trac/browser/examples/versioning/history_meta.py?rev=7253:3ef75b251d06#L171

So, in the listener, I want to record the user that made the change.
How should I get hold of the currently authenticated user?

The only way I can think of is calling pyramid.threadlocal.get_current_request inside the before_flush method of the VersionedListener, but having read:

http://docs.pylonsproject.org/projects/pyramid/1.0/narr/threadlocals.html#why-you-shouldn-t-abuse-thread-locals

I'm worried that I'm being evil. Am I being evil?
How else can I get hold of Pyramid's notion of the current user id inside a SessionExtension?

cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
           - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To post to this group, send email to pylons-devel@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-devel?hl=en.

Reply via email to