def cacheClassSets(self, class_obj): class_sets = memcache.get(str(class_obj.key().id())) if type(class_sets) is list: return class_sets else: class_sets = Set.all().filter('class_name =', class_obj) memcache.set(str(class_obj.key().id()), class_sets) return class_sets
def cacheSet(self, set_name, class_obj): set_obj = memcache.get(str(class_obj.key().id()) + set_name) if type(set_obj) is Set: return set_obj else: set_obj = Set.all().filter("class_name =", class_obj).filter("name =", set_name).get() memcache.set(str(class_obj.key().id()) + set_name, set_obj) return set_obj
def get_set_by_user(self, user, set_name): set_name = Set.all().filter('user ='******'name =', set_name) if set_name: return set_name.get()