def get(self): self.response.headers['Content-Type'] = 'application/json' curUser = users.get_current_user() if not curUser: self.error(400) return friends = [] friendsFromDs = Friendship.all() friendsFromDs.filter('user1 =', curUser) for friend in friendsFromDs: friends.append(friend.to_dict()) self.response.out.write(simplejson.dumps(friends))
def get(self): self.response.headers['Content-Type'] = 'application/json' curUser = users.get_current_user() if not curUser: self.error(400) return commonSections = {} friendsFromDs = Friendship.all() friendsFromDs.filter('user1 =', curUser) for friend in friendsFromDs: common = self.find_common_sections(curUser, friend) commonSections[str(friend.key())] = common self.response.out.write(simplejson.dumps(commonSections))