Beispiel #1
0
def view_order(request, order_id):
    
    form = OrderViewForm({'order_id' : order_id})
    if not form.is_valid():
        return response_error('%s' % form.errors,)

    return response_success(params={'order': form.cleaned_data['order_id'].output})
Beispiel #2
0
def create_order(request):
    
    form = OrderCreateForm(request.POST)
    if not form.is_valid():
        return response_error('%s' % form.errors,)

    Order().create_order(form.cleaned_data[REQ_CREATE_ORDER.PRODUCTS_ID])

    params = {'status': 'created'}
    return response_success(params=params)
Beispiel #3
0
def products_list(request):
    params = {'products': [p.output for p in Product.objects.all()]}
    return response_success(params=params)