Fixed some index bugs.
[didex.git] / didex / store.py
index 8008ee5..43c1348 100644 (file)
@@ -2,7 +2,7 @@ import threading, pickle
 from . import db, index, cache
 from .db import txnfun
 
-__all__ = ["environment", "store", "autostore"]
+__all__ = ["environment", "datastore", "autostore"]
 
 class environment(object):
     def __init__(self, *, path=None, getpath=None, recover=False):
@@ -44,7 +44,7 @@ def storedescs(obj):
         t.__didex_attr = ret
     return ret
 
-class store(object):
+class datastore(object):
     def __init__(self, name, *, env=None, path=".", ncache=None):
         self.name = name
         self.lk = threading.Lock()
@@ -107,6 +107,7 @@ class autotype(type):
     def __call__(self, *args, **kwargs):
         new = super().__call__(*args, **kwargs)
         new.id = self.store.register(new)
+        self.store.update(new.id, vfy=new) # This doesn't feel too nice.
         return new
 
 class autostore(object, metaclass=autotype):