コード例 #1
0
    def post(self, entity):
        """Starts following a user, defined by the post data"""
        try:
            post_data = json.loads(request.data)
        except json.JSONDecodeError as e:
            raise APIBadRequest(str(e))

        if not post_data:
            raise APIBadRequest("No POST data.")

        follower = follow.start_following(entity, post_data)
        return jsonify(follower.to_json())
コード例 #2
0
ファイル: entity.py プロジェクト: pytent/pytentd
    def post(self, entity):
        """Starts following a user, defined by the post data"""
        try:
            post_data = json.loads(request.data)
        except json.JSONDecodeError as e:
            raise APIBadRequest(str(e))

        if not post_data:
            raise APIBadRequest("No POST data.")

        follower = follow.start_following(entity, post_data)
        return jsonify(follower.to_json())
コード例 #3
0
ファイル: followers.py プロジェクト: rlanger/Rondo
 def post(self):
     """Starts following a user, defined by the post data"""
     return jsonify(follow.start_following(g.entity, request.json))
コード例 #4
0
ファイル: followers.py プロジェクト: rlanger/Rondo
 def post(self):
     """Starts following a user, defined by the post data"""
     return jsonify(follow.start_following(g.entity, request.json))