Mercurial > p > roundup > code
comparison doc/customizing.txt @ 7045:ca90f7270cd4 issue2550923_computed_property
merge from main tip. This should fix test failure in Markdown2TestCase.test_string_markdown_code_block_attribute by merging html diff method used in tests.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Mon, 07 Nov 2022 22:58:38 -0500 |
| parents | e1588ae185dc ff2c8b430738 |
| children | 82bbb95e5690 |
comparison
equal
deleted
inserted
replaced
| 6638:e1588ae185dc | 7045:ca90f7270cd4 |
|---|---|
| 1 .. meta:: | 1 .. meta:: |
| 2 :description language=en: | 2 :description: |
| 3 How to customize and extend the Roundup Issue | 3 How to customize and extend the Roundup Issue |
| 4 Tracker. Includes many cookbook and how-to | 4 Tracker. Includes many cookbook and how-to |
| 5 examples. Reference for the design and internals | 5 examples. Reference for the design and internals |
| 6 needed to understand and extend the examples to meet | 6 needed to understand and extend the examples to meet |
| 7 new needs. | 7 new needs. |
| 1499 Interfaces.py has been around since the earliest releases of roundup | 1499 Interfaces.py has been around since the earliest releases of roundup |
| 1500 and used to be the main way to get a lot of customization done. In | 1500 and used to be the main way to get a lot of customization done. In |
| 1501 modern roundup, the extensions_ mechanism is used, but there are | 1501 modern roundup, the extensions_ mechanism is used, but there are |
| 1502 places where interfaces.py is still useful. Note that the tracker | 1502 places where interfaces.py is still useful. Note that the tracker |
| 1503 directories are not on the Python system path when interfaces.py is | 1503 directories are not on the Python system path when interfaces.py is |
| 1504 evaluated. You need to add library directories explicty by | 1504 evaluated. You need to add library directories explictly by |
| 1505 modifying sys.path. | 1505 modifying sys.path. |
| 1506 | 1506 |
| 1507 Example: Changing Cache-Control headers | 1507 Example: Changing Cache-Control headers |
| 1508 --------------------------------------- | 1508 --------------------------------------- |
| 1509 | 1509 |
| 2244 This is usually used to show listings of class items. The URL for | 2244 This is usually used to show listings of class items. The URL for |
| 2245 for specific object of issue class with id 1 will look like: | 2245 for specific object of issue class with id 1 will look like: |
| 2246 | 2246 |
| 2247 8. ``/issue1`` | 2247 8. ``/issue1`` |
| 2248 | 2248 |
| 2249 .. _strip_zeros: | |
| 2250 | |
| 2251 Note that a leading string of 0's will be stripped from the id part of | |
| 2252 the object designator in the URL. E.G. ``/issue001`` is the same as | |
| 2253 ``/issue1``. Similarly for ``/file01`` etc. However you should | |
| 2254 generate URL's without the extra zeros. | |
| 2249 | 2255 |
| 2250 Determining web context | 2256 Determining web context |
| 2251 ----------------------- | 2257 ----------------------- |
| 2252 | 2258 |
| 2253 To determine the "context" of a request (what request is for), we look at | 2259 To determine the "context" of a request (what request is for), we look at |
| 2274 by raising SendStaticFile exception. | 2280 by raising SendStaticFile exception. |
| 2275 c. if there is something in the path (as in example 1, "issue"), it | 2281 c. if there is something in the path (as in example 1, "issue"), it |
| 2276 identifies the tracker class to display. | 2282 identifies the tracker class to display. |
| 2277 d. if the path is an item designator (as in examples 2 and 4, "issue1" | 2283 d. if the path is an item designator (as in examples 2 and 4, "issue1" |
| 2278 and "file1"), then we're to display a specific item. | 2284 and "file1"), then we're to display a specific item. |
| 2285 :ref:`Note. <strip_zeros>` | |
| 2279 e. if the path starts with an item designator and is longer than one | 2286 e. if the path starts with an item designator and is longer than one |
| 2280 entry (as in example 5, "file1/kitten.png"), then we're assumed to be | 2287 entry (as in example 5, "file1/kitten.png"), then we're assumed to be |
| 2281 handling an item of a ``FileClass``, and the extra path information | 2288 handling an item of a ``FileClass``, and the extra path information |
| 2282 gives the filename that the client is going to label the download | 2289 gives the filename that the client is going to label the download |
| 2283 with (i.e. "file1/kitten.png" is nicer to download than "file1"). | 2290 with (i.e. "file1/kitten.png" is nicer to download than "file1"). |
| 2735 | 2742 |
| 2736 | 2743 |
| 2737 Templating engines | 2744 Templating engines |
| 2738 ~~~~~~~~~~~~~~~~~~ | 2745 ~~~~~~~~~~~~~~~~~~ |
| 2739 | 2746 |
| 2740 Since version 1.4.20 Roundup supports two templating engines: the original | 2747 Since version 1.4.20 Roundup supports two templating engines: |
| 2741 `Template Attribute Language`_ (TAL) engine from Zope and the standalone | 2748 |
| 2742 Chameleon templating engine. Chameleon is intended as a replacement for the | 2749 * the original `Template Attribute Language`_ (TAL) engine from Zope |
| 2743 original TAL engine, and supports the same syntax, | 2750 * the standalone Chameleon templating engine. Chameleon is intended |
| 2744 but they are not 100% compatible. The major (and most likely the only) | 2751 as a replacement for the original TAL engine, and supports the |
| 2745 incompatibility is the default expression type being | 2752 same syntax, but they are not 100% compatible. The major (and most |
| 2746 ``python:`` instead of ``path:``. See also "Incompatibilities and | 2753 likely the only) incompatibility is the default expression type being |
| 2747 differences" section of `Chameleon documentation`__. | 2754 ``python:`` instead of ``path:``. See also "Incompatibilities and |
| 2755 differences" section of `Chameleon documentation`__. | |
| 2756 | |
| 2757 Version 1.5.0 added experimental support for the `jinja2`_ templating | |
| 2758 language. You must install the `jinja2`_ module in order to use it. The | |
| 2759 ``jinja2`` template supplied with Roundup has the templates rewritten | |
| 2760 to use ``jinja2`` rather than TAL. A number of trackers are running | |
| 2761 using ``jinja2`` templating so it is considered less experimental than | |
| 2762 Chameleon templating. | |
| 2763 | |
| 2764 .. _jinja2: https://palletsprojects.com/p/jinja/ | |
| 2765 | |
| 2748 | 2766 |
| 2749 **NOTE1**: For historical reasons, examples given below assumes path | 2767 **NOTE1**: For historical reasons, examples given below assumes path |
| 2750 expression as default expression type. With Chameleon you have to manually | 2768 expression as default expression type. With Chameleon you have to manually |
| 2751 resolve the path expressions. A Chameleon-based, z3c.pt, that is fully | 2769 resolve the path expressions. A Chameleon-based, z3c.pt, that is fully |
| 2752 compatible with the old TAL implementation, is planned to be included in a | 2770 compatible with the old TAL implementation, is planned to be included in a |
| 3398 | 3416 |
| 3399 Interval properties - render the interval in a pretty | 3417 Interval properties - render the interval in a pretty |
| 3400 format (eg. "yesterday"). The format arguments are those used | 3418 format (eg. "yesterday"). The format arguments are those used |
| 3401 in the standard ``strftime`` call (see the `Python Library | 3419 in the standard ``strftime`` call (see the `Python Library |
| 3402 Reference: time module`__) | 3420 Reference: time module`__) |
| 3421 | |
| 3422 Number properties - takes a printf style format argument | |
| 3423 (default: '%0.3f') and formats the number accordingly. | |
| 3424 If the value can't be converted, '' is returned if the | |
| 3425 value is ``None`` otherwise it is converted to a string. | |
| 3403 popcal Generate a link to a popup calendar which may be used to | 3426 popcal Generate a link to a popup calendar which may be used to |
| 3404 edit the date field, for example:: | 3427 edit the date field, for example:: |
| 3405 | 3428 |
| 3406 <span tal:replace="structure context/due/popcal" /> | 3429 <span tal:replace="structure context/due/popcal" /> |
| 3407 | 3430 |
