コード例 #1
0
def survey(request, survey_slug=None, template='survey/survey.html'):
    if request.GET.get('id', None) is not None and request.GET.get(
            'return', None) is not None:
        survey = get_object_or_404(
            Survey, slug='puget-sound-coastal-recreation-survey', anon=True)
        respondant, created = Respondant.objects.get_or_create(
            survey=survey, uuid=request.GET.get('id'))
        respondant.gfk_returnURL = request.GET.get('return')
        respondant.save()
        return redirect(
            "/respond#/survey/puget-sound-coastal-recreation-survey/%s" %
            (respondant.uuid))
    elif survey_slug is not None:
        survey = get_object_or_404(Survey, slug=survey_slug, anon=True)
        respondant = Respondant(survey=survey)
        respondant.save()
        if request.GET.get('get-uid', None) is not None:
            return HttpResponse(
                simplejson.dumps({
                    'success': "true",
                    "uuid": respondant.uuid
                }))
        return redirect("/respond#/survey/%s/%s" %
                        (survey.slug, respondant.uuid))
    context = {'ANALYTICS_ID': settings.ANALYTICS_ID}
    return render_to_response(template, RequestContext(request, context))
コード例 #2
0
ファイル: views.py プロジェクト: cheryltchen/geosurvey
def survey(request, survey_slug=None, template='survey/survey.html'):
    if survey_slug is not None:
        survey = get_object_or_404(Survey, slug=survey_slug, anon=True)
        respondant = Respondant(survey=survey)
        respondant.save()
        if request.GET.get('get-uid', None) is not None:
            return HttpResponse(simplejson.dumps({'success': "true", "uuid": respondant.uuid}))
        return redirect("/respond#/survey/%s/%s" % (survey.slug, respondant.uuid))
    return render_to_response(template, RequestContext(request, {}))
コード例 #3
0
ファイル: views.py プロジェクト: point97/survey-ost
def survey(request, survey_slug=None, template='survey/survey.html'):
    if survey_slug is not None:
        survey = get_object_or_404(Survey, slug=survey_slug, anon=True)
        respondant = Respondant(survey=survey, user=request.user)
        respondant.save()
        if request.GET.get('get-uid', None) is not None:
            return HttpResponse(simplejson.dumps({'success': "true", "uuid": respondant.uuid}))
        return redirect("/respond#/survey/%s/0/%s/landing" % (survey.slug, respondant.uuid))
    context = {'ANALYTICS_ID': settings.ANALYTICS_ID}
    return render_to_response(template, RequestContext(request, context))
コード例 #4
0
ファイル: views.py プロジェクト: twelch/hapifis
def dash(request, survey_slug=None, template='survey/dash.html'):
    if survey_slug is not None:
        survey = get_object_or_404(Survey, slug=survey_slug, anon=True)
        respondant = Respondant(survey=survey)
        respondant.save()
        if request.GET.get('get-uid', None) is not None:
            return HttpResponse(simplejson.dumps({'success': "true", "uuid": respondant.uuid}))
        return redirect("/respond#/survey/%s/%s" % (survey.slug, respondant.uuid))

    return render_to_response(template, RequestContext(request, {'api_key': request.user.api_key.key}))
コード例 #5
0
ファイル: views.py プロジェクト: twelch/hapifis
def survey(request, survey_slug=None, template='survey/survey.html'):
    if survey_slug is not None:
        survey = get_object_or_404(Survey, slug=survey_slug, anon=True)
        respondant = Respondant(survey=survey, surveyor=request.user)
        respondant.save()
        if request.GET.get('get-uid', None) is not None:
            return HttpResponse(simplejson.dumps({'success': "true", "uuid": respondant.uuid}))
        return redirect("/respond#/survey/%s/%s" % (survey.slug, respondant.uuid))
    context = {'ANALYTICS_ID': settings.ANALYTICS_ID}
    return render_to_response(template, RequestContext(request, context))
コード例 #6
0
ファイル: views.py プロジェクト: point97/puget-sound
def survey(request, survey_slug=None, template='survey/survey.html'):
    if request.GET.get('id', None) is not None and request.GET.get('return', None) is not None:
        survey = get_object_or_404(Survey, slug='puget-sound-coastal-recreation-survey', anon=True)
        respondant, created = Respondant.objects.get_or_create(survey=survey, uuid=request.GET.get('id'))
        respondant.gfk_returnURL = request.GET.get('return')
        respondant.save()
        return redirect("/respond#/survey/puget-sound-coastal-recreation-survey/%s" % (respondant.uuid))
    elif survey_slug is not None:
        survey = get_object_or_404(Survey, slug=survey_slug, anon=True)
        respondant = Respondant(survey=survey)
        respondant.save()
        if request.GET.get('get-uid', None) is not None:
            return HttpResponse(simplejson.dumps({'success': "true", "uuid": respondant.uuid}))
        return redirect("/respond#/survey/%s/%s" % (survey.slug, respondant.uuid))
    context = {'ANALYTICS_ID': settings.ANALYTICS_ID}
    return render_to_response(template, RequestContext(request, context))