[Moin-devel] Dataset and DataBrowserWidget class'

Nick Trout nick at rockstarvancouver.com
Mon May 3 12:17:10 EDT 2004


> Hey all. I'm doing some work with WikiDb and similar data techniques.
I
> read the request on the WikiDb to use the DataBrowserWidget for
display,
> which uses the Dataset class. There are some tools/functions that i
need
> from Dataset - mostly the ability to return the sum of a column. What
i
> want to know is, should i sub-class Dataset and add my own functions
to
> it, or should i be looking at adding these functions to Dataset
itself?

I thought what might be a good idea is to cache information stored in
tables in Python format so there's no need to parse it. Then the
DataBrowserWidget can use this information to sort-on-column and WikiDb
can use it to do its searches.

It would be quite nice to revamp table formatting as well. We use them
quite regularly and you have to add an awful lot of formatting in some
cases. Being able to set cell and row defaults would be handy. 

Perhaps ||| <properties> ||| could be a row which sets properties, but
is ignored? 

||| <rowbgcol=blue> <:>  |||
|| Name || Height || Weight ||
||| <rowbgcol=white> |||
|| Bob || 120 || 300 ||
|| John || 200 || 110 ||

This might also contain extra data which is useful for
DataBrowserWidget?

||| coltype(Name, alpha) coltype(Height, numeric) |||
||| coltype(Weight, numeric) |||
||| rowbgcol(blue) align(:) sort(Height, ascending) |||
||| function("x", int(value("Height")) * int(value("Weight")) ) ||

|| Name || Height || Weight || Height*Weight?! ||
||| <rowbgcol=white> |||
|| Bob || 120 || 300 || <fn "x"> ||
|| John || 200 || 110 || <fn "x"> ||

All of this stuff is optional for the user. I suppose you could write a
processor to do this instead.

Nick






More information about the Moin-devel mailing list