コード例 #1
0
    def delete(self, request, username):

        try:
            inUser = request.user
            otherUser = MyUser.objects.get(username=username)
        except ObjectDoesNotExist:
            return OutResponse.invalid_arguments()

        _status = FollowerRelation.do_unfollow(inUser, otherUser)
        if not _status:
            return OutResponse.entry_not_existent()

        return OutResponse.content_deleted(_status)
コード例 #2
0
    def delete(self, request, username):

        try:
            inUser = request.user
            otherUser = MyUser.objects.get(username=username)
        except ObjectDoesNotExist:
            return OutResponse.invalid_arguments()

        _status = FollowerRelation.do_unfollow(inUser,otherUser)
        if not _status:
            return OutResponse.entry_not_existent()

        return OutResponse.content_deleted(_status)
コード例 #3
0
    def delete(self, request, spot, username=None):
        if username is not None:
            return OutResponse.page_not_found()

        try:
            inUser = request.user
            inSpot = Spot.objects.get(id=spot)
        except ObjectDoesNotExist:
            return OutResponse.invalid_arguments()

        _status = Favorites.delete_favorite(inUser, inSpot)
        if not _status:
            return OutResponse.entry_not_existent()

        return OutResponse.content_deleted()
コード例 #4
0
    def delete(self, request,spot, username = None):
        if username is not None:
            return OutResponse.page_not_found()

        try:
            inUser = request.user
            inSpot = Spot.objects.get(id=spot)
        except ObjectDoesNotExist:
            return OutResponse.invalid_arguments()

        _status = Favorites.delete_favorite(inUser,inSpot)
        if not _status:
            return OutResponse.entry_not_existent()

        return OutResponse.content_deleted()