On 31/03/2011 15:40, Daniel Nouri wrote:
On Thu, Mar 31, 2011 at 4:23 PM, Chris Withers<ch...@simplistix.co.uk>  wrote:
Hi All,

I'm using zope.sqlalchemy to commit a a SQLAlchemy session.
As part of that commit, I want to record the user making the change as an
attribute of the changed object.

To do this, in a SessionExtension's before_flush method I do:

  user_id = authenticated_userid(get_current_request())

Now, the problem is that get_current_request() is returning None at this
point.

FWIW, get_current_request() works with 'before_insert' and
'before_update' events.

I don't see these listed here:

http://www.sqlalchemy.org/docs/orm/interfaces.html?highlight=sessionextension#sqlalchemy.orm.interfaces.SessionExtension

Where are you getting them from?

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