Guy Umbright wrote:

Given the following bit of python setup code:

<code>
db = metakit.storage("mkdelete.mk",1) mainView = db.getas("program[key:S,val1:I,val2:I]")



aView = mainView.select(key='aaa') </code>

what is the 'right' way to delete the records in aView
from mainView (in python)?

Banging my head on the desk on this....



I think this is the way:

indices = mainView.indices(aView)
mainView.remove(indices)

Here is a test script I just typed into the interpreter
>>> import metakit
>>> st = metakit.storage()
>>> view = st.getas("test[a,b:I]")
>>> for num, s in enumerate("abcdefg"):
...     view.append((s, num))
...
>>> s = view.select(a='a')
>>> indices = view.indices(s)
>>> view.remove(indices)
>>> metakit.dump(view)
a  b
-  -
b  1
c  2
d  3
e  4
f  5
g  6
-  -
Total: 6 rows
>>>

_____________________________________________
Metakit mailing list  -  [EMAIL PROTECTED]
http://www.equi4.com/mailman/listinfo/metakit

Reply via email to