[web2py] Re: how to rewrite an URL to drop a function name showing in the address bar

2017-08-27 Thread 98ujko9
I chose pattern-based rewrite because I don't know better. Please know that I am only temporary part time web coder relying on web2py book 100% with understanding at about 60%. Being a mature person I am fond of eloquence in life as well as in URL's however complexity has its price. I sense

[web2py] Re: web2py 2.15.3 is OUT

2017-08-27 Thread Anthony
It's not clear how that would be related to response.js, as it appears the code returned via response.js is in fact being executed in the browser. It's hard to say what's going wrong in the browser without knowing more about the JS and what the DOM looks like at that point. Anthony On Sunday,

[web2py] Re: web2py 2.15.3 is OUT

2017-08-27 Thread 黄祥
it seems response.js have a different behaviour in new version e.g. (the same code work well in 2.14.6) ... if form.process().accepted: ... target_response = "jQuery('#test .close').click(); jQuery('#test').get(0).reload()" response.js = target_response

[web2py] Re: how to rewrite an URL to drop a function name showing in the address bar

2017-08-27 Thread Anthony
Got it. Next, provide more detail regarding your current code/setup. Is there any particular reason you need to be using the pattern-based rewrite system? If so, you'll just need to create a regex that matches the route in question, or create a regex that matches all the other possible

[web2py] Re: Is it posible to fallback to static files when a controller is not found?

2017-08-27 Thread Alfonso Serra
Simpler and better approach: routes_in = ( # do not reroute admin unless you want to disable it (BASE + '/admin', '/admin/default/index') , (BASE + '/admin/$anything', '/admin/$anything') # do not reroute appadmin unless you want to disable it , (BASE + '/$app/appadmin',

[web2py] Re: Is it posible to fallback to static files when a controller is not found?

2017-08-27 Thread Alfonso Serra
Think i got it: routes.py: routes_onerror = [ # (r'init/400', r'/init/default/login') # ,(r'init/*', r'/init/static/fail.html') # ,(r'*/404', r'/init/static/cantfind.html') ('*/*', '/myapp/default/handle_error') ] In app/default.py def handle_error(): code =

[web2py] Re: how to rewrite an URL to drop a function name showing in the address bar

2017-08-27 Thread 98ujko9
I could make "asset" function the default for the "showcase" controller however I am not sure how as I am already using renamed routes.patterns.example.py in the root of the website (multiple apps) to rewrite one URL (works nicely): routes_out = ( ('/stock/default/index','/stock'),# <== my

[web2py] Re: how to rewrite an URL to drop a function name showing in the address bar

2017-08-27 Thread Anthony
On Saturday, August 26, 2017 at 4:05:59 PM UTC-4, 98uj...@gmail.com wrote: > > How can I rewrite the URL (to drop asset): > > https://192.168.1.25:8000/stock/showcase/asset/2017-Some-fridge?id=79&_signature=c2e7899530c858f1b478cb7ea5f03bb30d4f68e1 > to look like: > >

[web2py] Re: change_password validator

2017-08-27 Thread Anthony
First, the default validator is not IS_STRONG -- it is simply CRYPT with min_length set to auth.settings.password_min_length (which defaults to 4). Second, on the password change form, the validator is not ignored, but the min_length of CRYPT is set to 1 for the "Old Password" field only (this

[web2py] Re: change_password validator

2017-08-27 Thread Alfonso Serra
I was able to setup IS_STRONG like this: db.auth_user.password.requires.insert(0, IS_STRONG()) Be careful, after doing this users wont be able to log in if their password is not strong, validated. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Is it posible to fallback to static files when a controller is not found?

2017-08-27 Thread Alfonso Serra
im trying to fallback to the static folder when a controller is not found, for example: a route like: img is not a defined controller so i would like to redirect this route to "/static/img/mypicture.png", how do i do that? I have tried: BASE = '' # optonal prefix for incoming URLs

[web2py] Re: how to rewrite an URL to drop a function name showing in the address bar

2017-08-27 Thread Alfonso Serra
A solution would be to use routes.py in there you can place something like routes_in = [ ('/stock/showcase/$anything', '/stock/showcase/index/$anything') ] and use the index function to do whatever you like with the view. You redirect everything through the index function so you wont be able to