22HTML Templating Mechanisms
33==========================
44
5- :Version: $Revision: 1.11 $
5+ :Version: $Revision: 1.12 $
66
77Current Situation and Issues
88============================
@@ -138,9 +138,6 @@ I'm envisaging an infrastructure layer where each template has the following
138138"root level" (that is, directly accessible in the TALES namespace) variables
139139defined:
140140
141- *user*
142- The current user node as an HTMLItem instance
143-
144141*class*
145142 The current class of node being displayed as an HTMLClass instance
146143
@@ -158,6 +155,11 @@ defined:
158155 name, thus "user/name" and "user/name/menu" will still work - the latter
159156 will pull information from the form if it can.
160157
158+ this is a dangerous attribute, and may cause us pain the long run (its name
159+ may clash with other top-level variables ... it already clashed with the
160+ proposed *user* variable). It might be safer to go with just *class* and
161+ *item*, actually...
162+
161163*form*
162164 The current CGI form information as a mapping of form argument name to value
163165
@@ -167,6 +169,7 @@ defined:
167169 - the current index information (``filterspec``, ``filter`` args,
168170 ``properties``, etc) parsed out of the form.
169171 - methods for easy filterspec link generation
172+ - *user*, the current user node as an HTMLItem instance
170173
171174*instance*
172175 The current instance
@@ -180,15 +183,7 @@ defined:
180183*modules*
181184 python modules made available (XXX: not sure what's actually in there tho)
182185
183- Accesses through the *user*::
184-
185- class HTMLUser:
186- def hasPermission(self, ...)
187-
188- (note that the other permission check implemented by the security module may
189- be implemented easily in a tal:condition, so isn't needed here)
190-
191- Accesses through a class (either through *class* or *db.<classname>*):
186+ Accesses through a class (either through *class* or *db.<classname>*)::
192187
193188 class HTMLClass:
194189 def __getattr__(self, attr):
@@ -282,6 +277,14 @@ Multilink HTMLProperty
282277 def __init__(self, ...)
283278 def filterspec(self, ...)
284279
280+ Accesses through the *user* attribute of *request*::
281+
282+ class HTMLUser(HTMLItem):
283+ def hasPermission(self, ...)
284+
285+ (note that the other permission check implemented by the security module may
286+ be implemented easily in a tal:condition, so isn't needed here)
287+
285288Template files
286289~~~~~~~~~~~~~~
287290
0 commit comments