From: Michael Orlitzky Date: Wed, 24 Feb 2010 18:11:15 +0000 (-0500) Subject: Added the postback_url parameter to the LocationController. X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fcensus-tools.git;a=commitdiff_plain;h=a1ff47b818567962b111e77bdbf08b2966fb2691;hp=5a436a9d53621f9f30991ee3118f4fd16b3ec8dd Added the postback_url parameter to the LocationController. --- diff --git a/www/maps/maps/controllers/location.py b/www/maps/maps/controllers/location.py index dc38833..5bf517c 100644 --- a/www/maps/maps/controllers/location.py +++ b/www/maps/maps/controllers/location.py @@ -11,6 +11,9 @@ log = logging.getLogger(__name__) class LocationController(BaseController): + def __init__(self): + c.postback_url = None + def index(self): return render('/location/index.mako') @@ -18,6 +21,9 @@ class LocationController(BaseController): def route(self): if request.method != 'POST': return 'You should have posted some data.' + + if (c.postback_url == None): + c.postback_url = '/directions/json_to_kml' # Get the contents of the uploaded files. producers_data = request.POST['producers'].value.splitlines() @@ -46,3 +52,7 @@ class LocationController(BaseController): return render('location/route.mako') + def distance(self): + c.postback_url = '/directions/distances' + return self.route() +