@@ -2455,6 +2455,46 @@ the database.
24552455Adding a new field to the classic schema
24562456~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24572457
2458+ This example shows how to add a simple field (a due date) to the default
2459+ classic schema. It does not add any additional behaviour, such as enforcing
2460+ the due date, or causing automatic actions to fire if the due date passes.
2461+
2462+
2463+ 1. modify the schema::
2464+
2465+ issue = IssueClass(db, "issue",
2466+ assignedto=Link("user"), topic=Multilink("keyword"),
2467+ priority=Link("priority"), status=Link("status"),
2468+ due_dat=Date())
2469+
2470+ 2. add an edit field to the issue.item.html template::
2471+
2472+ <tr>
2473+ <th>Due Date</th>
2474+ <td tal:content="structure context/due_date/field" />
2475+ </tr>
2476+
2477+ 3. add the property to the issue.index.html page::
2478+
2479+ (in the heading row)
2480+ <th tal:condition="request/show/due_date">Due Date</th>
2481+ (in the data row)
2482+ <td tal:condition="request/show/priority" tal:content="i/due_date" />
2483+
2484+ 4. add the property to the issue.search.html page::
2485+
2486+ <tr tal:define="name string:due_date">
2487+ <th i18n:translate="">Due Date:</th>
2488+ <td metal:use-macro="search_input"></td>
2489+ <td metal:use-macro="column_input"></td>
2490+ <td metal:use-macro="sort_input"></td>
2491+ <td metal:use-macro="group_input"></td>
2492+ </tr>
2493+
2494+
2495+ Adding a new constrained field to the classic schema
2496+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2497+
24582498This example shows how to add a new constrained property (i.e. a
24592499selection of distinct values) to your tracker.
24602500
0 commit comments