X-Git-Url: http://git.veekun.com/zzz-floof.git/blobdiff_plain/5e8cb14114fb2a6f8b5c7c717c7f6e580ed5a95a..bedce37c00ee72650787b590e0e549bf6971f2e3:/floof/config/routing.py diff --git a/floof/config/routing.py b/floof/config/routing.py index c8f9e4e..6ec64e4 100644 --- a/floof/config/routing.py +++ b/floof/config/routing.py @@ -10,8 +10,13 @@ from routes import Mapper def make_map(): """Create, configure and return the routes Mapper""" map = Mapper(directory=config['pylons.paths']['controllers'], - always_scan=config['debug']) + always_scan=config['debug'], explicit=True) map.minimization = False + # explicit = True disables a broken feature called "route memory", + # where it adds everything matched in the current request as default variables + # for the next one. This is wrong because it doesn't invalidate things lower down in + # the hierarchy when higher up things change. Rails port failure. + # NOTE: this also disables actions defaulting to index, sorry. require_POST = dict(conditions={'method': ['POST']}) @@ -22,6 +27,7 @@ def make_map(): map.connect('/', controller='main', action='index') + # User stuff map.connect('/account/login', controller='account', action='login') map.connect('/account/login_begin', controller='account', action='login_begin', **require_POST) map.connect('/account/login_finish', controller='account', action='login_finish') @@ -29,6 +35,24 @@ def make_map(): map.connect('/account/register', controller='account', action='register') map.connect('/account/register_finish', controller='account', action='register_finish', **require_POST) - map.connect('/search', controller='search', action='index') + map.connect('/users', controller='users', action='list') + map.connect('/users/{name}', controller='users', action='view') + + # Art stuff + map.connect('/art/new', controller='art', action='new') + map.connect('/art/upload', controller='art', action='upload') + map.connect('show_art', '/art/{id}', controller='art', action='show') + map.connect('/art/{id}/tag', controller='art', action='tag') + + map.connect('/tag/{id}/delete', controller='tag', action='delete') + + map.connect('search', '/search', controller='search', action='index') + map.connect('/search/list', controller='search', action='list') + + + # default routing is back so we can test stuff. + # please don't take it away until we have some more core features in. + map.connect('/{controller}/{action}') + map.connect('/{controller}/{action}/{id}') return map