|
2 | 2 | HTML Templating Mechanisms |
3 | 3 | ========================== |
4 | 4 |
|
5 | | -:Version: $Revision: 1.9 $ |
| 5 | +:Version: $Revision: 1.10 $ |
6 | 6 |
|
7 | 7 | Current Situation and Issues |
8 | 8 | ============================ |
@@ -197,6 +197,10 @@ Accesses through a class (either through *class* or *db.<classname>*): |
197 | 197 | ''' return an HTMLItem instance ''' |
198 | 198 | def classhelp(self, ...) |
199 | 199 | def list(self, ...) |
| 200 | + def filter(self): |
| 201 | + ''' Return a list of items from this class, filtered and sorted |
| 202 | + by the current requested filterspec/filter/sort/group args |
| 203 | + ''' |
200 | 204 |
|
201 | 205 | Accesses through an *item*:: |
202 | 206 |
|
@@ -280,24 +284,43 @@ Multilink HTMLProperty |
280 | 284 | def __init__(self, ...) |
281 | 285 | def filterspec(self, ...) |
282 | 286 |
|
283 | | -Action |
284 | | -====== |
| 287 | +Template files |
| 288 | +~~~~~~~~~~~~~~ |
| 289 | + |
| 290 | +Each instance will have the opportunity to supply the following templates: |
| 291 | + |
| 292 | +page |
| 293 | + This is the overall page look template, and includes at some point a TAL |
| 294 | + command that includes the variable "content". This variable causes the actual |
| 295 | + page content to be generated. |
| 296 | + |
| 297 | +*.index |
| 298 | + Displays a list of items from the database, and a "filter refinement" form. |
| 299 | + Would perform a TAL ``repeat`` command using the list supplied by |
| 300 | + ``class/filter``. This deviates from the current situation in that currently |
| 301 | + the index template specifies a single row, and the filter part is |
| 302 | + automatically generated. |
| 303 | + |
| 304 | +*.item |
| 305 | + Displays a single item from the database using the *classname* variable (that |
| 306 | + is, the variable of the same name as the class being displayed. If |
| 307 | + |
| 308 | +*.filter |
| 309 | + Displays a full search form for a class. |
285 | 310 |
|
286 | | -1. Investigate how PageTemplates would be integrated into Roundup: |
| 311 | +Note that the newitem template doesn't really apply any more because the item |
| 312 | +templates may determine whether the page has an existing item to render. |
287 | 313 |
|
288 | | - - we could go for a fully-divorced-from-Zope approach, which would involve |
289 | | - bundling PageTemplates/TAL/ZTUtils in with Roundup, with all the |
290 | | - Zope-specific bits removed. |
291 | | - - we could try to coexist with a Zope installation, but there the problem |
292 | | - would be that Zope includes its own copy of PageTemplates/TAL/ZTUtils and |
293 | | - we'd be installing a version in site-packages, which would be bad. |
294 | 314 |
|
295 | | - The latter may allow nicer integration with Zope itself, giving Zope |
296 | | - Roundup users access to acquired information in their templates. We could |
297 | | - get around that by modifying the ZRoundup interface to use the "real Zope" |
298 | | - ZPT. Maybe. |
| 315 | +Integrating Code |
| 316 | +~~~~~~~~~~~~~~~~ |
299 | 317 |
|
300 | | -2. Implement the Roundup infrastructure described in the `implementation`_ |
301 | | - above. |
| 318 | +We will install PageTemplates, TAL and ZTUtils in site-packages. If there is a |
| 319 | +local Zope installation, it will use its own PageTemplates code (Zope modifies |
| 320 | +the module search path to give precedence to its own module library). |
302 | 321 |
|
| 322 | +We will then install the trivial MultiMapping and ComputedAttribute modules in |
| 323 | +the Roundup package, and have some import trickery that determines whether |
| 324 | +they are required, and if so they will be imported as if they were at the |
| 325 | +"top level" of the module namespace. |
303 | 326 |
|
0 commit comments