Hi Anthony,

Yes, my main point being especially that the average user cannot get to the 
bottom of it all.  I think that this is mostly a question of 
documentation,   but it would be nice to know what the limitations are so 
that time wasting can be avoided when users are trying to find a routing 
solution.

It may well be that the logic flow that I describe is how it already is.  
However,  before anyone can help improve the docs,  there has to be a clear 
understandable process. 

I think it is very useful that users can package all necessary routes in 
the app dir so it is excellent that this is the case and I'm glad that you 
found the example,  if I understand correctly.

Testing the routes is great,  so that is a good timesaver too.

I am sorry that my frustration has resulted in so many comments,  but 
hopefully all this will be clear soon.  I am on holiday at the moment,  but 
I will try to assist to make clarifications to the docs when I get back.

Many thanks,  D


On Friday, June 29, 2012 6:54:16 PM UTC+1, Anthony wrote:
>
> 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.
>
>
> Actually, according to the example file, you can have app-specific routes 
> in the app folder if desired: 
> http://code.google.com/p/web2py/source/browse/router.example.py#6. This 
> is not mentioned in the book.
>  
>
>> 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.
>>
>
> Isn't this basically how it already works (for both systems)? I think the 
> only catch is that if you do have app-specific routes in the application 
> folder, you also have to have a routes.py in the root folder in order to 
> indicate that (i.e., if there's no root routes.py, it won't attempt to do 
> any rewriting).
>  
>
>> @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.
>
>
> Here's what I said earlier:
>
> *Yes, I think the rewrite documentation could be improved, particularly 
> with more examples for cases like this.*
>
>
> I agree the documentation can be improved. I wasn't claiming the 
> documentation is generally adequate -- only that it does appear to 
> adequately communicate the particular point you were making, namely, that 
> the parameter-based system is simpler but has limitations and the 
> pattern-based system more complex but more flexible.
>
> Anthony
>

Reply via email to