]> gitweb.michael.orlitzky.com - dead/census-tools.git/commitdiff
Added the postback_url parameter to the LocationController.
authorMichael Orlitzky <michael@orlitzky.com>
Wed, 24 Feb 2010 18:11:15 +0000 (13:11 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Wed, 24 Feb 2010 18:11:15 +0000 (13:11 -0500)
www/maps/maps/controllers/location.py

index dc38833e56032a9f80abeecaea2a2cde0596ba3f..5bf517c0810212bfa43eca59cebceef3eeead3fc 100644 (file)
@@ -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()
+