[schooltool-dev] The things produced while i was visiting Belgium
Ignas Mikalajunas
ignas.mikalajunas at gmail.com
Mon Apr 23 06:31:43 EDT 2007
Hi, i know i am a bit late, but i find it difficult writing about
things i did (writing new code is so much easier), sorry. So what did
we do: schooltool was using zc.table directly and all the views that
had to display tables with batching had quite a lot of code
duplication in them. As jfroche needed to display ~1000 persons and it
was taking too much time we had to start indexing them, as more or
less all the person views were using zc.table adding the catalog code
to all the views would have added even more duplication so what we
have now is schooltool.table, that contains all the tabling, batching
and filtering code in it.
To use it for your container you register either the
SchoolToolTableFormatter or IndexedTableFormatter as an adapter to
ITableFormatter on the container and do something like:
self.table = ITableFormatter(contianer)
self.table.setUp()
in your view __call__
you get a table that easily integrates with zc.catalog. And can be
rendered with:
view/table/render , view/table/batching/render for batching,
view/table/filter_widget/render for the search box.
Ignas
More information about the Schooltool-dev
mailing list