[web2py] Re: how to detect if any view exists

2017-10-05 Thread Anthony
On Thursday, October 5, 2017 at 7:21:58 PM UTC-4, Alex Glaros wrote: > can you give me a tip on checking file system? Google. ;-) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: how to detect if any view exists

2017-10-05 Thread 黄祥
*e.g. not tested* import os filename = os.path.join(request.folder, 'views', '%s', '%s.%s') % (request.controller, request.function, 'html') if not os.path.exists(filename): your_code_goes_here best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: how to detect if any view exists

2017-10-05 Thread Alex Glaros
can you give me a tip on checking file system? {{myCurrentPage=str(request.function) + '.html'}} I tried {{if URL('default', myCurrentPage):}} {{include 'default/menu_favorites.html'}} {{pass}} and {{if request.folder,'default', myCurrentPage:}} {{include

[web2py] Re: how to detect if any view exists

2017-10-05 Thread Anthony
Just check if the file exists on the filesystem. On Thursday, October 5, 2017 at 6:21:23 PM UTC-4, Alex Glaros wrote: > > I have a bookmark on every page that appears via layout.html {{include > 'default/menu_favorites.html'}} that reads a small table > > If am testing a new function that does