]> ToastFreeware Gitweb - philipp/winterrodeln/wrfeed.git/blobdiff - wrfeed/config/routing.py
Renamed feed module in wrfeed (however, the URL stays the same).
[philipp/winterrodeln/wrfeed.git] / wrfeed / config / routing.py
diff --git a/wrfeed/config/routing.py b/wrfeed/config/routing.py
new file mode 100644 (file)
index 0000000..cb07750
--- /dev/null
@@ -0,0 +1,33 @@
+"""Routes configuration
+
+The more specific and detailed routes should be defined first so they
+may take precedent over the more generic routes. For more information
+refer to the routes manual at http://routes.groovie.org/docs/
+
+Format:
+    http://www.winterrodeln.org/feeds/berichte/alle
+    http://www.winterrodeln.org/feeds/berichte/bahn/kemater_alm
+    http://www.winterrodeln.org/feeds/berichte/bahnen/22+42+132 
+See:
+    http://www.winterrodeln.org/trac/wiki/UrlSchema
+"""
+from routes import Mapper
+
+def make_map(config):
+    """Create, configure and return the routes Mapper"""
+    map = Mapper(directory=config['pylons.paths']['controllers'],
+                 always_scan=config['debug'])
+    map.minimization = False
+    map.explicit = False
+
+    # The ErrorController route (handles 404/500 error pages); it should
+    # likely stay at the top, ensuring it can always be resolved
+    map.connect('/error/{action}', controller='error')
+    map.connect('/error/{action}/{id}', controller='error')
+
+    # CUSTOM ROUTES HERE
+
+    map.connect('/{controller}/{action}')
+    map.connect('/{controller}/{action}/{id}')
+
+    return map