|
2 | 2 | Customising Roundup |
3 | 3 | =================== |
4 | 4 |
|
5 | | -:Version: $Revision: 1.167 $ |
| 5 | +:Version: $Revision: 1.168 $ |
6 | 6 |
|
7 | 7 | .. This document borrows from the ZopeBook section on ZPT. The original is at: |
8 | 8 | http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx |
@@ -2614,6 +2614,46 @@ the database. |
2614 | 2614 | Adding a new field to the classic schema |
2615 | 2615 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
2616 | 2616 |
|
| 2617 | +This example shows how to add a simple field (a due date) to the default |
| 2618 | +classic schema. It does not add any additional behaviour, such as enforcing |
| 2619 | +the due date, or causing automatic actions to fire if the due date passes. |
| 2620 | + |
| 2621 | + |
| 2622 | +1. modify the schema:: |
| 2623 | + |
| 2624 | + issue = IssueClass(db, "issue", |
| 2625 | + assignedto=Link("user"), topic=Multilink("keyword"), |
| 2626 | + priority=Link("priority"), status=Link("status"), |
| 2627 | + due_dat=Date()) |
| 2628 | + |
| 2629 | +2. add an edit field to the issue.item.html template:: |
| 2630 | + |
| 2631 | + <tr> |
| 2632 | + <th>Due Date</th> |
| 2633 | + <td tal:content="structure context/due_date/field" /> |
| 2634 | + </tr> |
| 2635 | + |
| 2636 | +3. add the property to the issue.index.html page:: |
| 2637 | + |
| 2638 | + (in the heading row) |
| 2639 | + <th tal:condition="request/show/due_date">Due Date</th> |
| 2640 | + (in the data row) |
| 2641 | + <td tal:condition="request/show/priority" tal:content="i/due_date" /> |
| 2642 | + |
| 2643 | +4. add the property to the issue.search.html page:: |
| 2644 | + |
| 2645 | + <tr tal:define="name string:due_date"> |
| 2646 | + <th i18n:translate="">Due Date:</th> |
| 2647 | + <td metal:use-macro="search_input"></td> |
| 2648 | + <td metal:use-macro="column_input"></td> |
| 2649 | + <td metal:use-macro="sort_input"></td> |
| 2650 | + <td metal:use-macro="group_input"></td> |
| 2651 | + </tr> |
| 2652 | + |
| 2653 | + |
| 2654 | +Adding a new constrained field to the classic schema |
| 2655 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 2656 | + |
2617 | 2657 | This example shows how to add a new constrained property (i.e. a |
2618 | 2658 | selection of distinct values) to your tracker. |
2619 | 2659 |
|
|
0 commit comments