Hi,
I'm a newbie of Mk4py (wonderful) trying to understand how
to use this library in the correct way.
I had some problem with 'filter' method of views: how can
I use the result of the filtering to access the initial
records?
Something like this (doesn't work):
...
table=db.getas("income[VALUE:I]")
...
myfilter=lambda r: r.VALUE>12
result=table.filter(myfilter)
for i in result:
print i.VALUE #doesn't work
# or : print table[i].VALUE , but still doesn't work
I saw an old post by McMillan, suggesting "._index":
---------------------
view = db.view('customers')
myfilter = lambda(row: row.lname == 'Smi')
indices = view.filter(myfilter)
for indexrec in indices:
# do something with view[indexrec._index]
---------------------
but doesn't work too (._index no more supported?)
After that one, another messages said:
---------------------------
print "\n#############################################################"
print "view.filter doesn't return the whole row, just the matching"
print "indices in a table with an index attribute"
print "Not much can be done with these now, hopefully when the"
print "Mapped Index view is completed we can use this output"
print "to create a subview that has access to the rows of the"
print "original data"
----------------------------
Is there something new to use filter results now? What can I do
with a PyRowRef ?
Thanks in advance,
Emanuele
_______________________________________________
metakit mailing list - [EMAIL PROTECTED]
http://www.equi4.com/mailman/listinfo/metakit