Ejemplo n.º 1
0
 def readItemType(self, stored):
     # val = getattr(stored, "category")
     # category = val[-1]
     category = stored.categories[-1]
     typ = CategoryType(category)
     typ.mutable = self.mutable
     return typ
 def interpret (self, context):
     store = DataStore.instance
     query = self.buildFetchOneQuery(context, store)
     stored = store.fetchOne (query)
     if stored is None:
         return NullValue.instance
     else:
         typeName = stored.getData("category")[-1]
         typ = CategoryType(typeName)
         if self.typ is not None:
             typ.mutable = self.typ.mutable
         return typ.newInstanceFromStored (context, stored)