cybertools/tracking/notify
helmutm 3ddcf63821 extend tracking for loops.organize; changed tracks query to return a generator instead of a list; minor extensions for namespace/config stuff
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2508 fd906abe-77d9-0310-91a1-e0d9ade77398
2008-04-09 10:01:27 +00:00
..
__init__.py started work on comment (discussions) and notify (notifications) 2008-02-11 22:29:25 +00:00
base.py work in progress: basic implementation of notification features 2008-02-26 09:06:21 +00:00
interfaces.py work in progress: basic implementation of notification features 2008-02-26 09:06:21 +00:00
README.txt extend tracking for loops.organize; changed tracks query to return a generator instead of a list; minor extensions for namespace/config stuff 2008-04-09 10:01:27 +00:00
tests.py work in progress: basic implementation of notification features 2008-02-26 09:06:21 +00:00

=============
Notifications
=============

  ($Id$)

  >>> from zope import component
  >>> from cybertools.tracking.btree import TrackingStorage
  >>> from cybertools.tracking.notify.base import Notification, NotificationManager
  >>> component.provideAdapter(NotificationManager)

  >>> notifications = TrackingStorage(trackFactory=Notification)

  >>> from cybertools.tracking.notify.interfaces import INotificationManager
  >>> manager = INotificationManager(notifications)


Storing and Retrieving Notifications
====================================

  >>> manager.notify('obj01', 'user01', 'object_changed')

  >>> ntf01 = list(manager.query(userName='user01'))[0]
  >>> ntf01
  <Notification ['obj01', 1, 'user01', '...']:
  {'media': ['inbox'], 'state': 'new', 'type': 'object_changed'}>

  >>> print ntf01.state
  new
  >>> print ntf01.timingType
  None