def get(self): mall = Mall() student_list = filter(lambda user: user.type == 'student', mall.get_all_users()[0]) for user in student_list: user.auth_ids.append(user.u_email) ndb.put_multi(student_list) self.response.out.write('{} update sucessfully'.format(len(student_list)))
def mall(self): """ Stores the mall key as a cached a property """ mall_key = memcache.get_mall_key() if mall_key: return mall_key else: mall = Mall.get_or_create() if mall: mall_key = ndb.Key(mall.key.kind(), mall.key.id()) memcache.set_mall_key(mall_key) return mall_key return None
def get(self): mall = Mall.query().get() if not mall: mall = Mall() mall.create_event_list() self.response.out.write(mall.upcoming_event_list)