def hello(): if checkAcceptIsJson(request) and checkContentIsJson(request): setResponseContentTypeJson(response) hello = HelloWorld.fromJson(parseRequestToJson(request)) return parseObjectToJson(hello) else: return abort(404)
def quoteoftheday(): if checkAcceptIsJson(request) and checkContentIsJson(request): setResponseContentTypeJson(response) json = parseRequestToJson(request) updatedQuote = QuoteOfDay.update(author = json['author'], quote = json['quote'], date = date.today().isoformat()).where(QuoteOfDay.id == 1) updatedQuote.execute() else: return abort(404)
def getmath(): if checkAcceptIsJson(request) and checkContentIsJson(request): setResponseContentTypeJson(response) return parseObjectToJson(MathOperation.fromJson(parseRequestToJson(request))) else: return abort(404)