Mercurial > p > roundup > code
comparison doc/customizing.txt @ 1235:7441653e5330
added hook for external password validation, and some more docco
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 26 Sep 2002 23:59:08 +0000 |
| parents | c0a3b1c49ef7 |
| children | dd52bf10f934 |
comparison
equal
deleted
inserted
replaced
| 1234:c0a3b1c49ef7 | 1235:7441653e5330 |
|---|---|
| 1 =================== | 1 =================== |
| 2 Customising Roundup | 2 Customising Roundup |
| 3 =================== | 3 =================== |
| 4 | 4 |
| 5 :Version: $Revision: 1.48 $ | 5 :Version: $Revision: 1.49 $ |
| 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:: |
| 183 Note: if you modify the schema, you'll most likely need to edit the | 183 Note: if you modify the schema, you'll most likely need to edit the |
| 184 `web interface`_ HTML template files and `detectors`_ to reflect | 184 `web interface`_ HTML template files and `detectors`_ to reflect |
| 185 your changes. | 185 your changes. |
| 186 | 186 |
| 187 A tracker schema defines what data is stored in the tracker's database. | 187 A tracker schema defines what data is stored in the tracker's database. |
| 188 The schemas shipped with Roundup turn it into a typical software bug tracker | |
| 189 or help desk. | |
| 190 | |
| 191 XXX make sure we ship the help desk | |
| 192 | |
| 193 Schemas are defined using Python code in the ``dbinit.py`` module of your | 188 Schemas are defined using Python code in the ``dbinit.py`` module of your |
| 194 tracker. The "classic" schema looks like this:: | 189 tracker. The "classic" schema looks like this:: |
| 195 | 190 |
| 196 pri = Class(db, "priority", name=String(), order=String()) | 191 pri = Class(db, "priority", name=String(), order=String()) |
| 197 pri.setkey("name") | 192 pri.setkey("name") |
| 432 | 427 |
| 433 **Changing content after tracker initialisation** | 428 **Changing content after tracker initialisation** |
| 434 Use the roundup-admin interface's create, set and retire methods to add, | 429 Use the roundup-admin interface's create, set and retire methods to add, |
| 435 alter or remove items from the classes in question. | 430 alter or remove items from the classes in question. |
| 436 | 431 |
| 437 XXX example | 432 |
| 433 See "`adding a new field to the classic schema`_" for an example that requires | |
| 434 database content changes. | |
| 438 | 435 |
| 439 | 436 |
| 440 Web Interface | 437 Web Interface |
| 441 ============= | 438 ============= |
| 442 | 439 |
| 1530 Adding a field to the database | 1527 Adding a field to the database |
| 1531 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 1528 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1532 | 1529 |
| 1533 This is the easiest part of the change. The category would just be a plain | 1530 This is the easiest part of the change. The category would just be a plain |
| 1534 string, nothing fancy. To change what is in the database you need to add | 1531 string, nothing fancy. To change what is in the database you need to add |
| 1535 some lines to the ``open()`` function in ``dbinit.py``:: | 1532 some lines to the ``open()`` function in ``dbinit.py`` under the comment:: |
| 1533 | |
| 1534 # add any additional database schema configuration here | |
| 1535 | |
| 1536 add:: | |
| 1536 | 1537 |
| 1537 category = Class(db, "category", name=String()) | 1538 category = Class(db, "category", name=String()) |
| 1538 category.setkey("name") | 1539 category.setkey("name") |
| 1539 | 1540 |
| 1540 Here we are setting up a chunk of the database which we are calling | 1541 Here we are setting up a chunk of the database which we are calling |
| 1555 The Multilink() means that each issue can have many categories. If you were | 1556 The Multilink() means that each issue can have many categories. If you were |
| 1556 adding something with a more one to one relationship use Link() instead. | 1557 adding something with a more one to one relationship use Link() instead. |
| 1557 | 1558 |
| 1558 That is all you need to do to change the schema. The rest of the effort is | 1559 That is all you need to do to change the schema. The rest of the effort is |
| 1559 fiddling around so you can actually use the new category. | 1560 fiddling around so you can actually use the new category. |
| 1561 | |
| 1562 Populating the new category class | |
| 1563 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| 1564 | |
| 1565 If you haven't initialised the database with the roundup-admin "initialise" | |
| 1566 command, then you can add the following to the tracker ``dbinit.py`` in the | |
| 1567 ``init()`` function under the comment:: | |
| 1568 | |
| 1569 # add any additional database create steps here - but only if you | |
| 1570 # haven't initialised the database with the admin "initialise" command | |
| 1571 | |
| 1572 add:: | |
| 1573 | |
| 1574 category = db.getclass('category') | |
| 1575 category.create(name="scipy", order="1") | |
| 1576 category.create(name="chaco", order="2") | |
| 1577 category.create(name="weave", order="3") | |
| 1578 | |
| 1579 If the database is initalised, the you need to use the roundup-admin tool:: | |
| 1580 | |
| 1581 % roundup-admin -i <tracker home> | |
| 1582 Roundup <version> ready for input. | |
| 1583 Type "help" for help. | |
| 1584 roundup> create category name=scipy order=1 | |
| 1585 1 | |
| 1586 roundup> create category name=chaco order=1 | |
| 1587 2 | |
| 1588 roundup> create category name=weave order=1 | |
| 1589 3 | |
| 1590 roundup> exit... | |
| 1591 There are unsaved changes. Commit them (y/N)? y | |
| 1592 | |
| 1560 | 1593 |
| 1561 Setting up security on the new objects | 1594 Setting up security on the new objects |
| 1562 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 1595 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1563 | 1596 |
| 1564 By default only the admin user can look at and change objects. This doesn't | 1597 By default only the admin user can look at and change objects. This doesn't |
