Re: [web2py] Re: How to reuse view functions

2011-12-14 Thread Tito Garrido
Thank you guys! I will test it! On Fri, Dec 9, 2011 at 3:11 PM, Bruno Rocha wrote: > In that cases I prefer to keep the generators in server side. > > > modules/html_helpers.py > > from gluon import DIV > > class MySidebar(DIV): > def __init__(self): > # do whatever you want >

Re: [web2py] Re: How to reuse view functions

2011-12-09 Thread Bruno Rocha
In that cases I prefer to keep the generators in server side. modules/html_helpers.py from gluon import DIV class MySidebar(DIV): def __init__(self): # do whatever you want DIV.__init__(self) self.append(H1("mysidebar")) self.append(UL(*[LI().])) def

[web2py] Re: How to reuse view functions

2011-12-09 Thread Massimo Di Pierro
Yes but the {{include '...'}} should come after the {{extend '...'}} or inside the extended view. There is no reason to do it before. Mind that if your goal is to change a sidebar, I suggest you use {{block sidebar}}{{end}} On Dec 9, 4:53 am, Tito Garrido wrote: > So, is there any way to reu

Re: [web2py] Re: How to reuse view functions

2011-12-09 Thread Tito Garrido
So, is there any way to reuse a view function? Thanks! Tito On Thu, Dec 8, 2011 at 9:47 PM, Anthony wrote: > I don't think you can put an include before an extend (well, you can, but > it won't insert the include code before the extended view code, so if your > call to mysidebar() comes before

[web2py] Re: How to reuse view functions

2011-12-08 Thread Anthony
I don't think you can put an include before an extend (well, you can, but it won't insert the include code before the extended view code, so if your call to mysidebar() comes before the {{include}} statement in layout.html, this won't work). Anthony On Thursday, December 8, 2011 12:14:04 PM UT