Jean-Claude Wippler wrote:

Adam,

Maybe I am creating my hash all wrong.
view looks like
db=metakit.storage("foo.mk",1)
vw=db.getas("linelists[mid:S,field1:S,field2:S,field3:S,field4: S,field5:S,field6:S,field7:S]")


What should the mapped view look like?


The mapped view is always the same (2 ints):
    m=db.getas('map[_H:I,_R:I]')

And if I need to re-open this later on can I use the same view which I can save somewhere in a dictionary?


I don't understand "save in a dictionary".

By this I mean I was thinking about having a dictionary of views
mk_views={}
db=metakit.storage("foo.mk",1)
vw=db.getas("linelists[mid:S,field1:S,field2:S,field3:S,field4: S,field5:S,field6:S,field7:S]")
m=db.getas('map[_H:I,_R:I]')
vw=vw.hash(m,2)
mk_views[key]=vw


  and then to reuse I can just pull one out
   vw=mk_views[key]



You can re-open later with: vw = db.view("linelists").hash(db.view("map"),1)

You're not re-using the "map" view for other views as well, I hope? It has to be managed by hash() and it should not be used anywhere else but in the above setup.

Can you construct an example which fails? FWIW, there are some examples in the examples/ subdir of the MK source distribution, maybe they can be of use.

-jcw


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

Reply via email to