On 11/13/06, Ivan Vilata i Balaguer <[EMAIL PROTECTED]> wrote:
Jarrod Roberson (el 2006-11-09 a les 14:31:05 -0500) va dir::

> I am trying to create a property storage system for a webdav implementation.
>
> class Property(IsDescription):
>    name = StringCol(256)
>    value = StringCol(4096)
>
> I am using Property to create a table to store my data in.
>
> I also want to support "versioning" of the values.
>
> Is there a way to create a value field that can be "muli-valued" or
> "multi-dimensional" to so
> I can just continue to append data to that column?

Hi Jarrod,

If I understood your problem well, you could simply add a column
containing a timestamp for the particular name-value pair, and store
different versions of it in different rows of the same table.  For
instance::

    class VersionedProperty(IsDescription):
        time = Time64Col()
        name = StringCol(256)
        value = StringCol(4096)

Then, to get the last value of a property by its name (assuming that
they appear ordered by time in the table)::

    namecond = propstbl.cols.name == 'somename'
    propidx = propstbl.getWhereList(namecond, sort=True)[-1]
    propvalue = propstbl.read(propidx, field='value')


thanks, I considered doing something like that.

what I really wanted to know is there anyway to specify a variable length array as a column type.

I slapped together a VLArray where I store the name as the 0 entry, and all the versioned values
as subsequent entries but it takes up more room on the disk than the table does.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Pytables-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to