cybertools/reporter
helmutm 9202dd7bca added loops skin; + some minor changes
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@1183 fd906abe-77d9-0310-91a1-e0d9ade77398
2006-04-29 10:11:16 +00:00
..
browser starting the cybertools.reporter package... 2006-03-06 08:43:39 +00:00
example created the cybertools.typology package; + some related extensions and improvements on other packages 2006-03-07 18:00:39 +00:00
__init__.py starting the cybertools.reporter package... 2006-03-06 08:43:39 +00:00
configure.zcml starting the cybertools.reporter package... 2006-03-06 08:43:39 +00:00
cybertools.reporter-configure.zcml starting the cybertools.reporter package... 2006-03-06 08:43:39 +00:00
data.py starting the cybertools.reporter package... 2006-03-06 08:43:39 +00:00
interfaces.py starting the cybertools.reporter package... 2006-03-06 08:43:39 +00:00
README.txt added loops skin; + some minor changes 2006-04-29 10:11:16 +00:00
tests.py starting the cybertools.reporter package... 2006-03-06 08:43:39 +00:00

Quickstart Instructions
=======================

  ($Id$)

TO DO...

  >>> from zope.app import zapi
  >>> from zope.app.testing import ztapi
  >>> from zope.interface import directlyProvides

A Basic API for Reports and Listings
====================================

  >>> from cybertools.reporter.data import DataSource
  >>> from cybertools.reporter.interfaces import IResultSet

Let's start with the Person class from the example package - we will
then provide a listing of persons...

  >>> from cybertools.contact import Person
  >>> from cybertools.reporter.example.interfaces import IContactsDataSource
  >>> from cybertools.reporter.example.contact import Contacts

  >>> from datetime import date
  >>> pdata = ((u'John', u'Smith', '1956-08-01'),
  ...          (u'David', u'Waters', '1972-12-24'),
  ...          (u'Carla', u'Myers', '1981-10-11'))
  >>> persons = DataSource([Person(f, s, date(*[int(d) for d in b.split('-')]))
  ...                         for f, s, b in pdata])
  >>> directlyProvides(persons, IContactsDataSource)

  >>> ztapi.provideAdapter(IContactsDataSource, IResultSet, Contacts)
  >>> rset = IResultSet(persons)

  >>> len(rset)
  3

For the browser presentation we can also use a browser view providing
the result set with extended attributes:

  >>> #rsView = zapi.getMultiAdapter((context, TestRequest()), IBrowserView)

The reporter package also includes facilities for sorting the rows in a
result set and splitting a result into batches.

Sorting
-------

Batching
--------