On Mar 20, 2012, at 10:00 AM, Ruben Orduz wrote: > Not sure why so defensive. All I'm suggesting is that there is > precedent in simpler routing schemes: consider django's (or Rails'), > for instance. In django you have a urls.py at the root, and then > optionally one in your app folder. You have to explicitly tell the > root urls.py which urls to use for your app. There's no guesswork and > no contingent and thus no confusion. The routes auto-discovery and > contingencies, in this case, and in my opinion, are not intuitive and > I would say against the core python concept of explicit over implicit.
The rule for the parametric router (as opposed to the pattern-based router) is that a) you can put an app-specific router in the base routes.py, but b) if an app has its own parametric router in its own routes.py, it overrides the base routers. The pattern-based router would need additional syntax to accomplish (a), though I supposed you could write your regexes cleverly and accomplish the same general thing. I think that's the proper behavior, though it's not an apples-to-apples comparison. > > On Tue, Mar 20, 2012 at 12:43 PM, Anthony <abasta...@gmail.com> wrote: >>> I would suggest the following behavior though: >>> >>> routes_in and routes out in the _base_ routes.py should be completely >>> ignored if routes_app is not commented out. >> >> No, it should not. You may have multiple applications, but perhaps only some >> of them have app-specific routes (i.e., a routes.py file in the application >> folder). In that case, you want routes_app to match routes that belong to >> the apps with app-specific routes, but you want any routes that don't match >> routes_app to fall back to the routes_in/routes_out in your base routes.py >> file. We do not want to completely ignore routes_in/routes_out any time >> routes_app is present -- we only want to ignore them for the specific apps >> that are matched in routes_app. >> >>> >>> routes_app should be always completely ignored in _app-specific_ routes.py >> >> I believe this is already the case. The example file even says, "This entry >> is meaningful only in the base routes.py." >> >> It might be easier if you describe the routing you're trying to do so we can >> help you with your specific case. >> >> Anthony