Mercurial > p > roundup > code
comparison doc/customizing.txt @ 3476:1142dafe0d7f
added setorderprop() and setlabelprop() to Class (lots of patches)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 20 Jan 2006 02:40:56 +0000 |
| parents | fd32170475f5 |
| children | ef80a6c02e09 |
comparison
equal
deleted
inserted
replaced
| 3475:addbe69ff58b | 3476:1142dafe0d7f |
|---|---|
| 1 =================== | 1 =================== |
| 2 Customising Roundup | 2 Customising Roundup |
| 3 =================== | 3 =================== |
| 4 | 4 |
| 5 :Version: $Revision: 1.188 $ | 5 :Version: $Revision: 1.189 $ |
| 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:: |
| 350 | 350 |
| 351 | 351 |
| 352 The "classic" schema | 352 The "classic" schema |
| 353 -------------------- | 353 -------------------- |
| 354 | 354 |
| 355 The "classic" schema looks like this (see below for the meaning | 355 The "classic" schema looks like this (see section `setkey(property)`_ |
| 356 of ``'setkey'``):: | 356 below for the meaning of ``'setkey'`` -- you may also want to look into |
| 357 the sections `setlabelprop(property)`_ and `setorderprop(property)`_ for | |
| 358 specifying (default) labelling and ordering of classes.):: | |
| 357 | 359 |
| 358 pri = Class(db, "priority", name=String(), order=String()) | 360 pri = Class(db, "priority", name=String(), order=String()) |
| 359 pri.setkey("name") | 361 pri.setkey("name") |
| 360 | 362 |
| 361 stat = Class(db, "status", name=String(), order=String()) | 363 stat = Class(db, "status", name=String(), order=String()) |
| 546 | 548 |
| 547 roundup-admin set issue23 assignedto=richard | 549 roundup-admin set issue23 assignedto=richard |
| 548 | 550 |
| 549 Note, the same thing can be done in the web and e-mail interfaces. | 551 Note, the same thing can be done in the web and e-mail interfaces. |
| 550 | 552 |
| 551 If a class does not have an "order" property, the key is also used to | 553 setlabelprop(property) |
| 552 sort instances of the class when it is rendered in the user interface. | 554 ~~~~~~~~~~~~~~~~~~~~~~ |
| 553 (If a class has no "order" property, sorting is by the labelproperty of | 555 |
| 554 the class. This is computed, in order of precedence, as the key, the | 556 Select a property of the class to be the label property. The label |
| 555 "name", the "title", or the first property alphabetically.) | 557 property is used whereever an item should be uniquely identified, e.g., |
| 556 | 558 when displaying a link to an item. If setlabelprop is not specified for |
| 559 a class, the following values are tried for the label: | |
| 560 | |
| 561 * the key of the class (see the `setkey(property)`_ section above) | |
| 562 * the "name" property | |
| 563 * the "title" property | |
| 564 * the first property from the sorted property name list | |
| 565 | |
| 566 So in most cases you can get away without specifying setlabelprop | |
| 567 explicitly. | |
| 568 | |
| 569 setorderprop(property) | |
| 570 ~~~~~~~~~~~~~~~~~~~~~~ | |
| 571 | |
| 572 Select a property of the class to be the order property. The order | |
| 573 property is used whenever using a default sort order for the class, | |
| 574 e.g., when grouping or sorting class A by a link to class B in the user | |
| 575 interface, the order property of class B is used for sorting. If | |
| 576 setorderprop is not specified for a class, the following values are tried | |
| 577 for the order property: | |
| 578 | |
| 579 * the property named "order" | |
| 580 * the label property (see `setlabelprop(property)`_ above) | |
| 581 | |
| 582 So in most cases you can get away without specifying setorderprop | |
| 583 explicitly. | |
| 557 | 584 |
| 558 create(information) | 585 create(information) |
| 559 ~~~~~~~~~~~~~~~~~~~ | 586 ~~~~~~~~~~~~~~~~~~~ |
| 560 | 587 |
| 561 Create an item in the database. This is generally used to create items | 588 Create an item in the database. This is generally used to create items |
