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

        if not task:
            abort(404)

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

        if not task:
            abort(404)

        return task
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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