Ejemplo n.º 1
0
def select_riding_by_pcode(request,postalcode):
    pcodeobj = PostalCode(code=postalcode)
    return render_to_response('results/select_riding_by_pcode.html',
        {'page':'results',
         'subnav': "By Riding",
         'ridings': pcodeobj.get_ridings(),
        },context_instance=RequestContext(request))
Ejemplo n.º 2
0
def select_riding(request, voter_id):
    voter = get_object_or_404(Signup, id=voter_id)

    if request.method == "POST":
        riding = get_object_or_404(Riding, edid=request.POST["edid"])
        voter.set_riding(riding)
        voter.send_confirmation_email()
        return HttpResponseRedirect("/join/success.html")
    else:
        postalcode = PostalCode(code=voter.postalcode)
        ridings = postalcode.get_ridings()
        return render_to_response(
            "join/select_riding.html",
            {"page": "pledge", "voter": voter, "ridings": ridings},
            context_instance=RequestContext(request),
        )