Below is a test of something I thought of.
I create a hashed view and then store the view in a dictionary.
I then try and use the vw from teh dict. Fails every time with a system error.
Should this be able to work? Is my test code wrong somehow?








import metakit

class mk_test:

stored_views={}
def getVW(self,dt):
if self.stored_views.has_key(dt):
print "has view in dict"
return self.stored_views[dt]
else:
db=metakit.storage("temp"+dt+".mk",1)
db.autocommit()
vw=db.getas("linelists[mid:S,field:S]";)
m=db.getas(dt+'_map[_H:I,_R:I]')
vw=vw.hash(m,1)
self.stored_views[dt]=vw
return vw
def load(self,dt):
vw=self.getVW(dt)
for i in range(9):
vw.append(str(i),"ill")
def getRows(self,dt):
vw=self.getVW(dt)
for r in vw:
print r.mid,r.field


if __name__=="__main__":
   dt="01_01_2004"
   mt=mk_test()
   mt.load(dt)
   mt.getRows(dt)
_____________________________________________
Metakit mailing list  -  [EMAIL PROTECTED]
http://www.equi4.com/mailman/listinfo/metakit

Reply via email to