I am trying to use of SQLAlchemy event outside of web app.
SQLAlchemy event functions are in their own module --
from sqlalchemy import event
from pyramid.threadlocal import get_current_registry
event.listen(model.User, 'after_update', after_update_listener)
def after_update_listener(mapper, connection, target):
settings = get_current_registry().settings
...
which works well in the web app. However, get_current_registry()
returns nothing in paster command or bootstrap scripts.
How can I prepare the config values for get_current_registry()
manually?
Any pointer will be much appreciated.
Jerry
--
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.