示例#1
0
    def get(self, task_id=0, **kwargs):
        task = Task.get_by_id(task_id)

        if not task:
            abort(404)

        return task
示例#2
0
    def get(self, task_id=0, **kwargs):
        task = Task.get_by_id(task_id)

        if not task:
            abort(404)

        return task
示例#3
0
    def delete(self, task_id=0, **kwargs):
        task = Task.get_by_id(task_id)

        if not task:
            abort(404)

        task.delete()
        return 204
示例#4
0
    def post(self, task_id=0, **kwargs):
        task = Task.get_by_id(task_id)

        if not task:
            abort(404)

        task.update(**task_parser.parse_args())
        return task
示例#5
0
    def delete(self, task_id=0, **kwargs):
        task = Task.get_by_id(task_id)

        if not task:
            abort(404)

        task.delete()
        return 204
示例#6
0
    def post(self, task_id=0, **kwargs):
        task = Task.get_by_id(task_id)

        if not task:
            abort(404)

        task.update(**task_parser.parse_args())
        return task
示例#7
0
 def post(self, user_id=None, username=None):
     args = task_parser.parse_args()
     # user owns the task
     args['user_id'] = g.user.id
     task = Task.create(**args)
     return task, 201
示例#8
0
 def post(self, user_id=None, username=None):
     args = task_parser.parse_args()
     # user owns the task
     args['user_id'] = g.user.id
     task = Task.create(**args)
     return task, 201