Beispiel #1
0
def generate_pdf(request: WSGIRequest):
    parameters = parse_json_from_request(request)
    meal_parameters = {
        'category': 1,
        'name': 'name'
    }
    meal = MealService().create_meal(meal_parameters)
    PdfService().generate_pdf(meal)
    return HttpResponse()
Beispiel #2
0
def get_meal(request: WSGIRequest):
    parameters = parse_json_from_request(request)
    meal = MealService().get_meal(parameters)
    return JsonResponse(meal)
    return HttpResponse()
Beispiel #3
0
def update_meal(request: WSGIRequest):
    parameters = parse_json_from_request(request)
    MealService().update_meal(parameters)
    return HttpResponse()
Beispiel #4
0
def create_meal(request: WSGIRequest):
    parameters = parse_json_from_request(request)
    MealService().create_meal(parameters, request.user)
    return HttpResponse()
Beispiel #5
0
def meal_list(request: WSGIRequest):
    parameters = parse_json_from_request(request)
    meals = MealService().meal_list(parameters)
    return JsonResponse(meals, safe=False)
Beispiel #6
0
def get_product(request: WSGIRequest):
    parameters = parse_json_from_request(request)
    product = ProductService().get_product(parameters)
    return JsonResponse(product, safe=False)
Beispiel #7
0
def update_product(request: WSGIRequest):
    parameters = parse_json_from_request(request)
    ProductService().update_product(parameters)
    return HttpResponse()
Beispiel #8
0
def product_list(request: WSGIRequest):
    parameters = parse_json_from_request(request)
    products = ProductService().product_list(parameters)
    return JsonResponse(products, safe=False)
Beispiel #9
0
def get_category(request: WSGIRequest, name: str):
    parameters = parse_json_from_request(request)
    return HttpResponse()