I use metakit (python bindings) in my app
(grecipe-manager.sourceforge.net). In some of my early code, I made
some dumb decisions about data-types and I want to change the property
types for some columns now. Specifically, I want to take a string
column and convert it into an integer column.

This would be easy if I just wanted to create a new column...

for r in vw:
    r.new=int(r.old)

But I want the new column to have the same name as the old -- just a
new datatype.

Can anyone suggest an effecient way to do this? 

I've tried to cook up something, but aside from being inefficient (I
used a dummy column to hold the data in the mean time), it didn't
work. Metakit seems to remember the original datatype for my column,
even when I request a view with the new datatype.  The following code
raises a TypeError (Wrong type for String prop):

oldview = storage.getas('mydatabase[column:s]')
...
newview = storage.getas('mydatabase[column:I]')
for r in newview: r.column = 3

(the error was at r.column=3).

Also, on a somewhat related note, can anyone tell me how to delete a
column of data?

Thanks in advance for any and all help.
Tom
_____________________________________________
Metakit mailing list  -  [email protected]
http://www.equi4.com/mailman/listinfo/metakit

Reply via email to