hi all,
i put the word "dynamic" in quotes, as i'm not sure if it's the right
term. i'm working on an application in Python that should allow the user to
interactively define a database structure. i.e., i do not know beforehand
what the database is going to look like.
creating a database this way is not a problem: i can simply build a
description string for all the views from the input of the user and then
call getas with that:
>>> descr = 'entry[stem:S,category:S,id:I]'
>>> vw = db.getas(descr)
and populate it like this:
>>> vw.append(('tree', 'n', 1))
but the problem is that retrieving the information can AFAIK only be done
with keywords:
>>> print vw[0].stem
'tree'
but this is problematic: i do not know beforehand which names the user will
choose for the properties/columns. so i would like to be able to do
something like this:
>>> print vw[0]['stem']
'tree'
so that instead of the string 'stem' i can pass a variable holding a string
to index the desired column.
this, however, gives an error. i've been trying other ways, and i've been
looking at the Mk4Py documentation, but i don't see anything that would
make this possible. is there a way to do this? or is there a different way
to achieve a "dynamic" database?
TIA
--
Joost Kremers
Life has its moments
_______________________________________________
metakit mailing list - [EMAIL PROTECTED]
http://www.equi4.com/mailman/listinfo/metakit