From 2631c344dd111d394e7914d50830e8cf6c4525d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Barna?= Date: Fri, 28 Oct 2016 11:51:54 +0200 Subject: [PATCH] Add parameters and post handler --- controllers/default_controller.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/controllers/default_controller.py b/controllers/default_controller.py index 94ad2a8..3dfc59e 100644 --- a/controllers/default_controller.py +++ b/controllers/default_controller.py @@ -1,6 +1,15 @@ +from flask import Flask, request +from flask_restful import Resource, Api + +from models import Duck + +#app = def ducks_get(): return 'do some magic!' -def duck_get(): +def duck_get( duck_id ): return 'do some duck magic!' +def duck_post( name, color ): + new_duck = Duck( name, color ) + return new_duck