[web2py] Re: views: {{include var}}

2015-06-24 Thread Dmitry Ermolaev
thanx - it work! in controller: spath = 'views/default/pages/' + cat.folder + '/' spath1 = '/' + request.application + '/default/stream/' + spath return dict(page=request.folder + spath + rec.file_, sp=spath1, h=h, f=f) and I add path to urls by

[web2py] Re: views: {{include var}}

2015-06-24 Thread Dmitry Ermolaev
if that variable [page] not in globals - error raised if [page] is setted - all work среда, 24 июня 2015 г., 15:42:56 UTC+3 пользователь Anthony написал: > > {{include}} and {{extend}} are template directives, not Python code. So, > even if the Python "if" statement evaluates to False, the {{incl

[web2py] Re: views: {{include var}}

2015-06-24 Thread Dmitry Ermolaev
solve: use response.render: in controller: from gluon.fileutils import read_file spath = 'static/pages/' + cat.folder + '/' spath1 = '/' + request.application + '/' + spath h += XML(response.render(request.folder + spath + rec.file_, dict(sp=spath1

[web2py] Re: views: {{include var}}

2015-06-24 Thread Anthony
{{include}} and {{extend}} are template directives, not Python code. So, even if the Python "if" statement evaluates to False, the {{include page}} will still remain in the template and get executed (though once the actual template code is included there, *that *code will not be executed). So,