Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)