Spurred by this discussion, I implemented a simple events system
that's akin to Zope3's object events.

>From the docs:

  To subscribe only to insert events of documents, do::

  def document_insert_handler(event):
      print event.object, event.request
  kotti.events.objectevent_listeners[(kotti.events.ObjectInsert,
kotti.resources.Document)].append(
      document_insert_handler)

The actual insert, update, delete events are still coming from
SQLAlchemy but turned into events that hide away calls to
"get_current_request" and the necessity to deal with SQLAlchemy
internals, that is, calls to "session.is_modified" on update.

See https://github.com/dnouri/Kotti/blob/master/kotti/events.py


-- 
Daniel Nouri
http://danielnouri.org

-- 
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