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