def __init__(self, store_id, attributes={}): # set default instance values self.defaults = {} stored = RedisHashes.getall(store_id) if type(stored) == dict: stored.update(attributes) elif stored == None: stored = attributes else: raise Exception('get unsupported type %s', str(type(stored))) self.attributes = stored
def save(self): return RedisHashes.save(self.store_id, self.attributes)