Exemplo n.º 1
0
def matching_courses(request):
    if len(request.GET['term']) == 0:
        raise http.Http404

    matching_nodes = drupal.get_matching_courses(term=request.GET['term'])
    json = simplejson.dumps(matching_nodes)

    return http.HttpResponse(json, mimetype="application/json")
Exemplo n.º 2
0
def matching_courses(request):
    if len(request.GET['term']) == 0:
        raise http.Http404

    matching_nodes = drupal.get_matching_courses(term=request.GET['term'])
    json = simplejson.dumps(matching_nodes)

    return http.HttpResponse(json, mimetype="application/json")
Exemplo n.º 3
0
def matching_courses(request):
    if len(request.GET['term']) == 0:
        raise CommandException(_("Invalid request"))
    school = None
    if 'school' in request.GET:
        try:
            school = School.objects.get(slug=request.GET['school'])
        except School.DoesNotExist:
            pass
    matching_nodes = drupal.get_matching_courses(school=school, term=request.GET['term'])
    json = simplejson.dumps(matching_nodes)

    return HttpResponse(json, mimetype="application/x-javascript")
Exemplo n.º 4
0
def matching_courses(request):
    if len(request.GET['term']) == 0:
        raise CommandException(_("Invalid request"))
    school = None
    if 'school' in request.GET:
        try:
            school = School.objects.get(slug=request.GET['school'])
        except School.DoesNotExist:
            pass
    matching_nodes = drupal.get_matching_courses(school=school, term=request.GET['term'])
    json = simplejson.dumps(matching_nodes)

    return HttpResponse(json, mimetype="application/x-javascript")