Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Ruben Orduz
Anthony, cool. I did come up with a very similar approach. routes_in = ( (r'^/model1/?$', APPNAME_MODEL1_URL), (r'^/model1/(?P[^/]*)/?$', APPNAME_MODEL1_ID_URL), (r'^/model1/(?P[^/]*)/model2/?$', APPNAME_MODEL2_URL), (r'^/model1/(?P[^/]*)/model2/

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Anthony
I suppose something like: routes_in = ( (r'/appname/model1/$id1/model2/$id2/model3/$id3', '/appname/model3/index/$id1/$id2/$id3'), (r'/appname/model1/$id1/model2/$id2', '/appname/model2/index/$id1/$id2'), (r'/appname/model1/$id1', '/appname/model1/index/$id1') ) In that case, the va

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Anthony
> > Not sure why so defensive. Sorry, not meaning to be defensive, just trying to explain how it works. > All I'm suggesting is that there is > precedent in simpler routing schemes: consider django's (or Rails'), > for instance. So far, you've only made two suggestions, one of which is alre

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Ruben Orduz
Now more to our use case: a few days ago I wrote asking how could I accomplish and more logical-relational url scheme. One of the "hard" requirements from our customer is to have no action names in the URL and actions should be distinguished via REST. They also asked us to preserve relationships in

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Jonathan Lundell
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 t

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Ruben Orduz
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

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Anthony
> > 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 route

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Ruben Orduz
Perhaps I'm misreading your answers, but now I'm more confused. I'll keep bumping my head till I figure out a way or else use apache's mod_rewrite which is a heck lot more straight forward. I would suggest the following behavior though: routes_in and routes out in the _base_ routes.py should be c

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Anthony
> > I'm definitely confused with this routing scheme. > > There's the base routes.py (which is usually ignored due to file > name). > Note sure what you mean -- if you have a /web2py/routes.py file, it will not be ignored. web2py comes with two example files, routes.parameter_example.py and rout

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Jonathan Lundell
On Mar 20, 2012, at 8:18 AM, Ruben Orduz wrote: > Jonathan, thx for your answers. Now, as a pre-emtive follow up if I > have a routes.py in my app root directory: > > 1) should I rename/comment out the base routes.py? No, but all it needs is routes_app. > 2) should I commend routes_app in the ap

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Ruben Orduz
Jonathan, thx for your answers. Now, as a pre-emtive follow up if I have a routes.py in my app root directory: 1) should I rename/comment out the base routes.py? 2) should I commend routes_app in the app-specific routes.py? Thx. On Tue, Mar 20, 2012 at 11:11 AM, Jonathan Lundell wrote: > On Mar

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Jonathan Lundell
On Mar 20, 2012, at 8:09 AM, Ruben Orduz wrote: > > I'm definitely confused with this routing scheme. > > There's the base routes.py (which is usually ignored due to file > name). Inside this file there are 3 examples (routes_app, routes_in > and routes_out). So, assuming you change the name of t

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Ruben Orduz
I'm definitely confused with this routing scheme. There's the base routes.py (which is usually ignored due to file name). Inside this file there are 3 examples (routes_app, routes_in and routes_out). So, assuming you change the name of the file routes.py and restart your server, it will use routes

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Jonathan Lundell
On Mar 20, 2012, at 7:22 AM, rdodev wrote: > Alright, I need some assistance in this regard. So, after I managed web2py to > pick up the routes.py, it simply won't work (not even with the provided > examples in that file). I keep getting "Bad Request" response even for the > "welcome" app. Not s

[web2py] Re: routes.py not picking up

2012-03-20 Thread rdodev
Alright, I need some assistance in this regard. So, after I managed web2py to pick up the routes.py, it simply won't work (not even with the provided examples in that file). I keep getting "Bad Request" response even for the "welcome" app. Not sure what patterns is the router expecting. Again, a

Re: [web2py] Re: routes.py not picking up

2012-03-19 Thread Ruben Orduz
Another thing that needs to be pointed out (at least this is the case in Windows) that modifications to this file require a full web2py server shutdown/restart. If you use the tk UI to "stop" server and then "start" server, it will not pick up changes in the file -- perhaps this is obvious to some,

Re: [web2py] Re: routes.py not picking up

2012-03-16 Thread Anthony
> > ok removing those and re-starting web2py worked (well it broke, but that's > a good thing). Thx all for your help. If it's not on to-do list: maybe it > should be to improve (or to make clearer in the docs) how the routes.py > works and that you need to comment our routes_app in order for i

Re: [web2py] Re: routes.py not picking up

2012-03-16 Thread Jonathan Lundell
On Mar 16, 2012, at 6:58 PM, Anthony wrote: > On Friday, March 16, 2012 9:46:33 PM UTC-4, Jonathan Lundell wrote: > On Mar 16, 2012, at 6:39 PM, Anthony wrote: >> I'm not sure, but I think if you have routes_app, it will ignore routes_in >> and routes_out in the root routes.py if the request is fo

Re: [web2py] Re: routes.py not picking up

2012-03-16 Thread rdodev
ok removing those and re-starting web2py worked (well it broke, but that's a good thing). Thx all for your help. If it's not on to-do list: maybe it should be to improve (or to make clearer in the docs) how the routes.py works and that you need to comment our routes_app in order for it to work.

Re: [web2py] Re: routes.py not picking up

2012-03-16 Thread rdodev
Let me remove those, and I'll check back. On Friday, March 16, 2012 9:58:12 PM UTC-4, Anthony wrote: > > On Friday, March 16, 2012 9:46:33 PM UTC-4, Jonathan Lundell wrote: >> >> On Mar 16, 2012, at 6:39 PM, Anthony wrote: >> >> I'm not sure, but I think if you have routes_app, it will ignore >>

Re: [web2py] Re: routes.py not picking up

2012-03-16 Thread Anthony
On Friday, March 16, 2012 9:46:33 PM UTC-4, Jonathan Lundell wrote: > > On Mar 16, 2012, at 6:39 PM, Anthony wrote: > > I'm not sure, but I think if you have routes_app, it will ignore routes_in > and routes_out in the root routes.py if the request is for one of the apps > in routes_app. If you'r

Re: [web2py] Re: routes.py not picking up

2012-03-16 Thread Jonathan Lundell
On Mar 16, 2012, at 6:39 PM, Anthony wrote: > I'm not sure, but I think if you have routes_app, it will ignore routes_in > and routes_out in the root routes.py if the request is for one of the apps in > routes_app. If you're using routes_app, then you also need routes.py files > within the speci

[web2py] Re: routes.py not picking up

2012-03-16 Thread Anthony
I'm not sure, but I think if you have routes_app, it will ignore routes_in and routes_out in the root routes.py if the request is for one of the apps in routes_app. If you're using routes_app, then you also need routes.py files within the specific application folders as well. Anthony On Friday

[web2py] Re: routes.py not picking up

2012-03-16 Thread rdodev
Paste of routes.py that lives in web2py root folder. http://dpaste.com/717611/ On Friday, March 16, 2012 6:25:30 PM UTC-4, Anthony wrote: > > To be clear, you have a file called "routes.py" in your root /web2py > folder? Can you show the contents? What are you expecting, and what are you > see

[web2py] Re: routes.py not picking up

2012-03-16 Thread Anthony
To be clear, you have a file called "routes.py" in your root /web2py folder? Can you show the contents? What are you expecting, and what are you seeing instead? On Friday, March 16, 2012 4:57:48 PM UTC-4, rdodev wrote: > > Hey all, > > I have renamed (and edited) routes.py for both incoming and