cybertools/roa
helmutm a1ef7dd6d9 work in progress: REST/JSON traversal and views
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3525 fd906abe-77d9-0310-91a1-e0d9ade77398
2009-08-29 16:46:38 +00:00
..
z2 work in progress: REST/JSON traversal and views 2009-08-29 16:46:38 +00:00
__init__.py new package roa / resource-oriented architecture implementation, using JSON format for message exchange 2009-08-29 15:04:42 +00:00
json.py work in progress: REST/JSON traversal and views 2009-08-29 16:46:38 +00:00
README.txt work in progress: REST/JSON traversal and views 2009-08-29 16:46:38 +00:00
tests.py new package roa / resource-oriented architecture implementation, using JSON format for message exchange 2009-08-29 15:04:42 +00:00
traversal.py work in progress: REST/JSON traversal and views 2009-08-29 16:46:38 +00:00

==============================
Resource-oriented Architecture
==============================

  ($Id$)

  >>> from zope import component
  >>> from zope.publisher.browser import TestRequest


Providing object data in JSON format
====================================

  >>> class Demo(object):
  ...     def __init__(self, name):
  ...         self.name = name

  >>> from cybertools.roa.json import JSONView

  >>> obj = Demo('test')
  >>> jsv = JSONView(obj, TestRequest())
  >>> jsv()
  '["name"]'