Skip to content

Commit ddbe5d7

Browse files
author
Richard Jones
committed
new example
1 parent cf8f924 commit ddbe5d7

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

doc/customizing.txt

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Customising Roundup
33
===================
44

5-
:Version: $Revision: 1.167 $
5+
:Version: $Revision: 1.168 $
66

77
.. This document borrows from the ZopeBook section on ZPT. The original is at:
88
http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx
@@ -2614,6 +2614,46 @@ the database.
26142614
Adding a new field to the classic schema
26152615
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26162616

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+
26172657
This example shows how to add a new constrained property (i.e. a
26182658
selection of distinct values) to your tracker.
26192659

0 commit comments

Comments
 (0)