Exemplo n.º 1
0
def model_lookup_view(request):
    result = {"error": False}

    form = ModelLookupForm(request, request.GET)

    if form.is_valid():
        items, total = form.lookup()
        result["items"] = items
        result["total"] = total
    else:
        result["error"] = True

    return JsonResponse(result)
Exemplo n.º 2
0
def model_lookup_view(request):
    result = {'error': False}

    form = ModelLookupForm(request.GET)

    if form.is_valid():
        items, total = form.lookup()
        result['items'] = items
        result['total'] = total
    else:
        result['error'] = True

    return JsonResponse(result)
Exemplo n.º 3
0
def model_lookup_view(request):
    result = {"error": False}

    form = ModelLookupForm(request.GET)

    if form.is_valid():
        items, total = form.lookup()
        result["items"] = items
        result["total"] = total
    else:
        result["error"] = True

    return JsonResponse(result)
Exemplo n.º 4
0
def model_lookup_view(request):
    result = {'error': False}

    form = ModelLookupForm(request, request.GET)

    if form.is_valid():
        items, total = form.lookup()
        result['items'] = items
        result['total'] = total
    else:
        result['error'] = True

    return JsonResponse(result)
Exemplo n.º 5
0
def model_lookup_view(request):
    from jet.forms import ModelLookupForm
    from jet.utils import JsonResponse

    result = {
        'error': False
    }

    form = ModelLookupForm(request, request.GET)

    if form.is_valid():
        items, total = form.lookup(request.user)
        result['items'] = items
        result['total'] = total
    else:
        result['error'] = True

    return JsonResponse(result)