Mercurial > p > roundup > code
comparison doc/customizing.txt @ 2886:0998d1b48182
documentation updates
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 08 Nov 2004 23:29:45 +0000 |
| parents | 1ca5ebe9b16a |
| children | 21a0b049fed8 |
comparison
equal
deleted
inserted
replaced
| 2884:6d6fdd1daf92 | 2886:0998d1b48182 |
|---|---|
| 1 =================== | 1 =================== |
| 2 Customising Roundup | 2 Customising Roundup |
| 3 =================== | 3 =================== |
| 4 | 4 |
| 5 :Version: $Revision: 1.150 $ | 5 :Version: $Revision: 1.151 $ |
| 6 | 6 |
| 7 .. This document borrows from the ZopeBook section on ZPT. The original is at: | 7 .. This document borrows from the ZopeBook section on ZPT. The original is at: |
| 8 http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx | 8 http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx |
| 9 | 9 |
| 10 .. contents:: | 10 .. contents:: |
| 2037 url_quote quote some text as safe for a URL (ie. space, %, ...) | 2037 url_quote quote some text as safe for a URL (ie. space, %, ...) |
| 2038 html_quote quote some text as safe in HTML (ie. <, >, ...) | 2038 html_quote quote some text as safe in HTML (ie. <, >, ...) |
| 2039 =============== ======================================================== | 2039 =============== ======================================================== |
| 2040 | 2040 |
| 2041 You may add additional utility methods by writing them in your tracker | 2041 You may add additional utility methods by writing them in your tracker |
| 2042 ``interfaces.py`` module's ``TemplatingUtils`` class. See `adding a time | 2042 ``extensions`` directory and registering them with the templating system. |
| 2043 log to your issues`_ for an example. The TemplatingUtils class itself | 2043 |
| 2044 will have a single attribute, ``client``, which may be used to access | |
| 2045 the ``client.db`` when you need to perform arbitrary database queries. | |
| 2046 | 2044 |
| 2047 Batching | 2045 Batching |
| 2048 :::::::: | 2046 :::::::: |
| 2049 | 2047 |
| 2050 Use Batch to turn a list of items, or item ids of a given class, into a | 2048 Use Batch to turn a list of items, or item ids of a given class, into a |
| 2416 | 2414 |
| 2417 | 2415 |
| 2418 Register the action class | 2416 Register the action class |
| 2419 ~~~~~~~~~~~~~~~~~~~~~~~~~~ | 2417 ~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 2420 | 2418 |
| 2419 XXX update for new extensions setup (then search for interfaces.py and make | |
| 2420 sure there's no examples that use the old style) | |
| 2421 | |
| 2421 The class is now written, but isn't available to the user until you add it to | 2422 The class is now written, but isn't available to the user until you add it to |
| 2422 the ``instance.Client`` class ``actions`` variable, like so:: | 2423 the ``instance.Client`` class ``actions`` variable, like so:: |
| 2423 | 2424 |
| 2424 actions = client.Client.actions + ( | 2425 actions = client.Client.actions + ( |
| 2425 ('myaction', myActionClass), | 2426 ('myaction', myActionClass), |
| 2939 4. We want to display a total of the time log times that have been | 2940 4. We want to display a total of the time log times that have been |
| 2940 accumulated for an issue. To do this, we'll need to actually write | 2941 accumulated for an issue. To do this, we'll need to actually write |
| 2941 some Python code, since it's beyond the scope of PageTemplates to | 2942 some Python code, since it's beyond the scope of PageTemplates to |
| 2942 perform such calculations. We do this by adding a method to the | 2943 perform such calculations. We do this by adding a method to the |
| 2943 TemplatingUtils class in our tracker ``interfaces.py`` module:: | 2944 TemplatingUtils class in our tracker ``interfaces.py`` module:: |
| 2945 | |
| 2946 XXX update this example for TemplatingUtils -> extensions | |
| 2944 | 2947 |
| 2945 class TemplatingUtils: | 2948 class TemplatingUtils: |
| 2946 ''' Methods implemented on this class will be available to HTML | 2949 ''' Methods implemented on this class will be available to HTML |
| 2947 templates through the 'utils' variable. | 2950 templates through the 'utils' variable. |
| 2948 ''' | 2951 ''' |
