On Jun 29, 2012, at 8:47 AM, villas wrote: > @Jonathan. > Parametric Router. I just read the book again and I had overlooked that with > the parametric router you cannot have app specific routes in the app folder. > That is a shame because I had always thought a main advantage of having an > app specific routes.py is so that it could be distributed with the app. This > in itself may be a reason to avoid it. An app that depends on this > functionality cannot be distributed in the normal way? > > I cannot see why the root routes.py cannot determine whether it has > recognised an app. Afterall, we are telling it the app names. > > I am suggesting the flow as follows: > 1. Look for root routes.py. > 2. See whether there are any apps specified which have their own routing. > The test for this is simply to look at the first arg of the URL after the > domain:port. The routes can already do that, can't they? > 3. If app specific routes apply, then go and get the app/routes.py and > follow that. > 4. If not, then follow the default routes.
Example: both routers are capable of routing to an application based on some combination of scheme, domain & port, in which case the app name is typically not present in the incoming URL. > > In all cases, the user can opt for parametric routes or pattern routes. > Maybe a flag at the start of each file should make it clear which. > > I am not asking for anything which isn't already available in one form or > another. You are saying it is non-trivial. Well I definitely agree with > that! However, if it already available, then surely it is possible. > > @Anthony. As you say, the naming is not really an issue as long as > everything is clear and you suggest the documentation is pretty adequate -- > but evidently it is not. In my original post above, I described a simple > case which appears to be possible with the parametric router, but you > concede that it is not. This has got me wondering how we might make all this > more obvious, so that in future people like me can figure it out without > wasting other peoples' time. > > In referring back to my original post, I am hoping that this test case will > be a catalyst to getting a clearer routing solution.