[web2py] Re: Insert current datetime in layout.html

2010-06-14 Thread Niphlod
You can use request.now, that is a default datetime.datetime object.. e.g. (paste this on the view) month: {{=request.now.month}} day : {{=request.now.day}} ... On 14 Giu, 00:32, Giuseppe Luca Scrofani wrote: > Hi, how I can insert in a page not served by a controller (think > layout.

[web2py] Re: Insert current datetime in layout.html

2010-06-14 Thread mdipierro
No do not worry. The import only happes the first time, than the module is cached. On Jun 13, 5:32 pm, Giuseppe Luca Scrofani wrote: > Hi, how I can insert in a page not served by a controller (think > layout.html in the welcome application) current day and month? > > I've tested something like

[web2py] Re: Insert current datetime in layout.html

2010-06-14 Thread Richard
If you want this variable globally available for all views then put `giugno = 6' into a model. Or if you only want this variable for a certain view then pass it explicitly in the controller with `return dict(giugno=6, ...)' Then in the view[s] you can use {{= giugno }} On Jun 14, 11:58 pm, Giuse

Re: [web2py] Re: Insert current datetime in layout.html

2010-06-14 Thread Giuseppe Luca Scrofani
Thanks for answering friends, it worked! Now, how I can setup a condition block to transform the digit returned by {{=request.now.month}} (example: 6) into something like "giugno" (june in italian language)? > e.g. (paste this on the view) > > month: {{=request.now.month}} > day : {{=reque

Re: [web2py] Re: Insert current datetime in layout.html

2010-06-19 Thread Giuseppe Luca Scrofani
Thanks friend :) > If you want this variable globally available for all views then put > `giugno = 6' into a model. > Or if you only want this variable for a certain view then pass it > explicitly in the controller with `return dict(giugno=6, ...)'