Template designer API¶
The template context¶
This is a list template context names available when parsing a template.
This is just a start and far from being complete...
-
this
¶ The printable object instance
-
site
¶ shortcut for settings.SITE
-
mtos
¶ "amount to string" using
decfmt()
-
iif
¶ iif
-
_(s)
¶ gettext
-
E
¶ HTML tag generator, see
etgen.html
-
unicode()
¶ the builtin Python
unicode()
function
-
len()
¶ the builtin Python
len()
function
-
settings``
¶ The Django
settings.py
module
-
site`
¶ shortcut for settings.SITE
-
ar
¶ a Lino
lino.core.requests.BaseRequest
instance around the calling Django request
-
request`
¶ the Django HttpRequest instance (available in
admin_main.html
, rendered byget_main_html
, which callslino.core.web.render_from_request()
)
Date formatting functions¶
Lino includes shortcuts to python-babel's date formatting functions:
-
fds
¶ "format date short", see Date formatting functions
-
fdm
¶ "format date medium", see Date formatting functions
-
fdl
¶ "format date long", see Date formatting functions
-
fdf
¶ "format date full", see Date formatting functions
Examples:
>>> d = datetime.date(2013,8,26)
>>> print(fds(d)) # short
26/08/2013
>>> print(fdm(d)) # medium
26 Aug 2013
>>> print(fdl(d)) # long
26 August 2013
>>> print(fdf(d)) # full
Monday, 26 August 2013