Mercurial > p > roundup > code
annotate doc/customizing.txt @ 1198:1c5bc0e2ed7d
*** empty log message ***
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 24 Sep 2002 02:00:52 +0000 |
| parents | e2b5f02cefe3 |
| children | 3a5e05edcd87 |
| rev | line source |
|---|---|
|
688
b38f4f95bffd
More doc tweaks
Richard Jones <richard@users.sourceforge.net>
parents:
686
diff
changeset
|
1 =================== |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2 Customising Roundup |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
3 =================== |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
4 |
| 1164 | 5 :Version: $Revision: 1.43 $ |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
6 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
7 .. This document borrows from the ZopeBook section on ZPT. The original is at: |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
8 http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx |
|
686
c52122f38c9b
Documentation cleanup, added info for potential (and current) developers
Richard Jones <richard@users.sourceforge.net>
parents:
684
diff
changeset
|
9 |
|
c52122f38c9b
Documentation cleanup, added info for potential (and current) developers
Richard Jones <richard@users.sourceforge.net>
parents:
684
diff
changeset
|
10 .. contents:: |
| 1125 | 11 :depth: 1 |
|
686
c52122f38c9b
Documentation cleanup, added info for potential (and current) developers
Richard Jones <richard@users.sourceforge.net>
parents:
684
diff
changeset
|
12 |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
13 What You Can Do |
| 1098 | 14 =============== |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
15 |
| 935 | 16 Customisation of Roundup can take one of five forms: |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
17 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
18 1. `tracker configuration`_ file changes |
|
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
19 2. database, or `tracker schema`_ changes |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
20 3. "definition" class `database content`_ changes |
|
909
ef9c759c243e
Fix to hasPermission, thanks Stefan Seefeld.
Richard Jones <richard@users.sourceforge.net>
parents:
907
diff
changeset
|
21 4. behavioural changes, through detectors_ |
| 935 | 22 5. `access controls`_ |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
23 |
|
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
24 The third case is special because it takes two distinctly different forms |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
25 depending upon whether the tracker has been initialised or not. The other two |
|
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
26 may be done at any time, before or after tracker initialisation. Yes, this |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
27 includes adding or removing properties from classes. |
|
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
28 |
|
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
29 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
30 Trackers in a Nutshell |
| 1098 | 31 ====================== |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
32 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
33 Trackers have the following structure: |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
34 |
| 1098 | 35 =================== ======================================================== |
| 36 Tracker File Description | |
| 37 =================== ======================================================== | |
| 38 config.py Holds the basic `tracker configuration`_ | |
| 39 dbinit.py Holds the `tracker schema`_ | |
| 40 interfaces.py Defines the Web and E-Mail interfaces for the tracker | |
| 41 select_db.py Selects the database back-end for the tracker | |
| 42 db/ Holds the tracker's database | |
| 43 db/files/ Holds the tracker's upload files and messages | |
| 44 detectors/ Auditors and reactors for this tracker | |
| 45 html/ Web interface templates, images and style sheets | |
| 46 =================== ======================================================== | |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
47 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
48 Tracker Configuration |
| 1098 | 49 ===================== |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
50 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
51 The config.py located in your tracker home contains the basic |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
52 configuration for the web and e-mail components of roundup's interfaces. This |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
53 file is a Python module. The configuration variables available are: |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
54 |
|
1096
fa7df238e2d4
More cleaning up of configuration, and the "instance" -> "tracker" renaming.
Richard Jones <richard@users.sourceforge.net>
parents:
1091
diff
changeset
|
55 **TRACKER_HOME** - ``os.path.split(__file__)[0]`` |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
56 The tracker home directory. The above default code will automatically |
|
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
57 determine the tracker home for you. |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
58 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
59 **MAILHOST** - ``'localhost'`` |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
60 The SMTP mail host that roundup will use to send e-mail. |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
61 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
62 **MAIL_DOMAIN** - ``'your.tracker.email.domain.example'`` |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
63 The domain name used for email addresses. |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
64 |
|
1096
fa7df238e2d4
More cleaning up of configuration, and the "instance" -> "tracker" renaming.
Richard Jones <richard@users.sourceforge.net>
parents:
1091
diff
changeset
|
65 **DATABASE** - ``os.path.join(TRACKER_HOME, 'db')`` |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
66 This is the directory that the database is going to be stored in. By default |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
67 it is in the tracker home. |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
68 |
|
1096
fa7df238e2d4
More cleaning up of configuration, and the "instance" -> "tracker" renaming.
Richard Jones <richard@users.sourceforge.net>
parents:
1091
diff
changeset
|
69 **TEMPLATES** - ``os.path.join(TRACKER_HOME, 'html')`` |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
70 This is the directory that the HTML templates reside in. By default they are |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
71 in the tracker home. |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
72 |
|
1096
fa7df238e2d4
More cleaning up of configuration, and the "instance" -> "tracker" renaming.
Richard Jones <richard@users.sourceforge.net>
parents:
1091
diff
changeset
|
73 **TRACKER_NAME** - ``'Roundup issue tracker'`` |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
74 A descriptive name for your roundup tracker. This is sent out in e-mails and |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
75 appears in the heading of CGI pages. |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
76 |
|
1096
fa7df238e2d4
More cleaning up of configuration, and the "instance" -> "tracker" renaming.
Richard Jones <richard@users.sourceforge.net>
parents:
1091
diff
changeset
|
77 **TRACKER_EMAIL** - ``'issue_tracker@%s'%MAIL_DOMAIN`` |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
78 The email address that e-mail sent to roundup should go to. Think of it as the |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
79 tracker's personal e-mail address. |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
80 |
|
1096
fa7df238e2d4
More cleaning up of configuration, and the "instance" -> "tracker" renaming.
Richard Jones <richard@users.sourceforge.net>
parents:
1091
diff
changeset
|
81 **TRACKER_WEB** - ``'http://your.tracker.url.example/'`` |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
82 The web address that the tracker is viewable at. This will be included in |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
83 information sent to users of the tracker. |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
84 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
85 **ADMIN_EMAIL** - ``'roundup-admin@%s'%MAIL_DOMAIN`` |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
86 The email address that roundup will complain to if it runs into trouble. |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
87 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
88 **MESSAGES_TO_AUTHOR** - ``'yes'`` or``'no'`` |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
89 Send nosy messages to the author of the message. |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
90 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
91 **ADD_AUTHOR_TO_NOSY** - ``'new'``, ``'yes'`` or ``'no'`` |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
92 Does the author of a message get placed on the nosy list automatically? |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
93 If ``'new'`` is used, then the author will only be added when a message |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
94 creates a new issue. If ``'yes'``, then the author will be added on followups |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
95 too. If ``'no'``, they're never added to the nosy. |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
96 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
97 **ADD_RECIPIENTS_TO_NOSY** - ``'new'``, ``'yes'`` or ``'no'`` |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
98 Do the recipients (To:, Cc:) of a message get placed on the nosy list? |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
99 If ``'new'`` is used, then the recipients will only be added when a message |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
100 creates a new issue. If ``'yes'``, then the recipients will be added on |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
101 followups too. If ``'no'``, they're never added to the nosy. |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
102 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
103 **EMAIL_SIGNATURE_POSITION** - ``'top'``, ``'bottom'`` or ``'none'`` |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
104 Where to place the email signature in messages that Roundup generates. |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
105 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
106 **EMAIL_KEEP_QUOTED_TEXT** - ``'yes'`` or ``'no'`` |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
107 Keep email citations. Citations are the part of e-mail which the sender has |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
108 quoted in their reply to previous e-mail. |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
109 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
110 **EMAIL_LEAVE_BODY_UNCHANGED** - ``'no'`` |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
111 Preserve the email body as is. Enabiling this will cause the entire message |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
112 body to be stored, including all citations and signatures. It should be |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
113 either ``'yes'`` or ``'no'``. |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
114 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
115 **MAIL_DEFAULT_CLASS** - ``'issue'`` or ``''`` |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
116 Default class to use in the mailgw if one isn't supplied in email |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
117 subjects. To disable, comment out the variable below or leave it blank. |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
118 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
119 The default config.py is given below - as you |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
120 can see, the MAIL_DOMAIN must be edited before any interaction with the |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
121 tracker is attempted.:: |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
122 |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
123 # roundup home is this package's directory |
|
1096
fa7df238e2d4
More cleaning up of configuration, and the "instance" -> "tracker" renaming.
Richard Jones <richard@users.sourceforge.net>
parents:
1091
diff
changeset
|
124 TRACKER_HOME=os.path.split(__file__)[0] |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
125 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
126 # The SMTP mail host that roundup will use to send mail |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
127 MAILHOST = 'localhost' |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
128 |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
129 # The domain name used for email addresses. |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
130 MAIL_DOMAIN = 'your.tracker.email.domain.example' |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
131 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
132 # This is the directory that the database is going to be stored in |
|
1096
fa7df238e2d4
More cleaning up of configuration, and the "instance" -> "tracker" renaming.
Richard Jones <richard@users.sourceforge.net>
parents:
1091
diff
changeset
|
133 DATABASE = os.path.join(TRACKER_HOME, 'db') |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
134 |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
135 # This is the directory that the HTML templates reside in |
|
1096
fa7df238e2d4
More cleaning up of configuration, and the "instance" -> "tracker" renaming.
Richard Jones <richard@users.sourceforge.net>
parents:
1091
diff
changeset
|
136 TEMPLATES = os.path.join(TRACKER_HOME, 'html') |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
137 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
138 # A descriptive name for your roundup tracker |
|
1096
fa7df238e2d4
More cleaning up of configuration, and the "instance" -> "tracker" renaming.
Richard Jones <richard@users.sourceforge.net>
parents:
1091
diff
changeset
|
139 TRACKER_NAME = 'Roundup issue tracker' |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
140 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
141 # The email address that mail to roundup should go to |
|
1096
fa7df238e2d4
More cleaning up of configuration, and the "instance" -> "tracker" renaming.
Richard Jones <richard@users.sourceforge.net>
parents:
1091
diff
changeset
|
142 TRACKER_EMAIL = 'issue_tracker@%s'%MAIL_DOMAIN |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
143 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
144 # The web address that the tracker is viewable at |
|
1096
fa7df238e2d4
More cleaning up of configuration, and the "instance" -> "tracker" renaming.
Richard Jones <richard@users.sourceforge.net>
parents:
1091
diff
changeset
|
145 TRACKER_WEB = 'http://your.tracker.url.example/' |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
146 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
147 # The email address that roundup will complain to if it runs into trouble |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
148 ADMIN_EMAIL = 'roundup-admin@%s'%MAIL_DOMAIN |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
149 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
150 # Send nosy messages to the author of the message |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
151 MESSAGES_TO_AUTHOR = 'no' # either 'yes' or 'no' |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
152 |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
153 # Does the author of a message get placed on the nosy list automatically? |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
154 # If 'new' is used, then the author will only be added when a message |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
155 # creates a new issue. If 'yes', then the author will be added on followups |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
156 # too. If 'no', they're never added to the nosy. |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
157 ADD_AUTHOR_TO_NOSY = 'new' # one of 'yes', 'no', 'new' |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
158 |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
159 # Do the recipients (To:, Cc:) of a message get placed on the nosy list? |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
160 # If 'new' is used, then the recipients will only be added when a message |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
161 # creates a new issue. If 'yes', then the recipients will be added on followups |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
162 # too. If 'no', they're never added to the nosy. |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
163 ADD_RECIPIENTS_TO_NOSY = 'new' # either 'yes', 'no', 'new' |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
164 |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
165 # Where to place the email signature |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
166 EMAIL_SIGNATURE_POSITION = 'bottom' # one of 'top', 'bottom', 'none' |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
167 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
168 # Keep email citations |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
169 EMAIL_KEEP_QUOTED_TEXT = 'no' # either 'yes' or 'no' |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
170 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
171 # Preserve the email body as is |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
172 EMAIL_LEAVE_BODY_UNCHANGED = 'no' # either 'yes' or 'no' |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
173 |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
174 # Default class to use in the mailgw if one isn't supplied in email |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
175 # subjects. To disable, comment out the variable below or leave it blank. |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
176 # Examples: |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
177 MAIL_DEFAULT_CLASS = 'issue' # use "issue" class by default |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
178 #MAIL_DEFAULT_CLASS = '' # disable (or just comment the var out) |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
179 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
180 Tracker Schema |
| 1098 | 181 ============== |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
182 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
183 Note: if you modify the schema, you'll most likely need to edit the |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
184 `web interface`_ HTML template files and `detectors`_ to reflect |
|
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
185 your changes. |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
186 |
| 1091 | 187 A tracker schema defines what data is stored in the tracker's database. |
| 188 The | |
| 189 schemas shipped with Roundup turn it into a typical software bug tracker or | |
| 190 help desk. | |
| 191 | |
| 192 XXX make sure we ship the help desk | |
| 193 | |
| 194 Schemas are defined using Python code in the ``dbinit.py`` module of your | |
| 195 tracker. The "classic" schema looks like this:: | |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
196 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
197 pri = Class(db, "priority", name=String(), order=String()) |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
198 pri.setkey("name") |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
199 pri.create(name="critical", order="1") |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
200 pri.create(name="urgent", order="2") |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
201 pri.create(name="bug", order="3") |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
202 pri.create(name="feature", order="4") |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
203 pri.create(name="wish", order="5") |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
204 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
205 stat = Class(db, "status", name=String(), order=String()) |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
206 stat.setkey("name") |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
207 stat.create(name="unread", order="1") |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
208 stat.create(name="deferred", order="2") |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
209 stat.create(name="chatting", order="3") |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
210 stat.create(name="need-eg", order="4") |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
211 stat.create(name="in-progress", order="5") |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
212 stat.create(name="testing", order="6") |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
213 stat.create(name="done-cbb", order="7") |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
214 stat.create(name="resolved", order="8") |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
215 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
216 keyword = Class(db, "keyword", name=String()) |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
217 keyword.setkey("name") |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
218 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
219 user = Class(db, "user", username=String(), password=String(), |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
220 address=String(), realname=String(), phone=String(), |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
221 organisation=String()) |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
222 user.setkey("username") |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
223 user.create(username="admin", password=adminpw, |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
224 address=config.ADMIN_EMAIL) |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
225 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
226 msg = FileClass(db, "msg", author=Link("user"), recipients=Multilink |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
227 ("user"), date=Date(), summary=String(), files=Multilink("file")) |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
228 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
229 file = FileClass(db, "file", name=String(), type=String()) |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
230 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
231 issue = IssueClass(db, "issue", assignedto=Link("user"), |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
232 topic=Multilink("keyword"), priority=Link("priority"), status=Link |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
233 ("status")) |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
234 issue.setkey('title') |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
235 |
| 1083 | 236 XXX security definitions |
| 237 | |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
238 Classes and Properties - creating a new information store |
| 1098 | 239 --------------------------------------------------------- |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
240 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
241 In the tracker above, we've defined 7 classes of information: |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
242 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
243 priority |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
244 Defines the possible levels of urgency for issues. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
245 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
246 status |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
247 Defines the possible states of processing the issue may be in. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
248 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
249 keyword |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
250 Initially empty, will hold keywords useful for searching issues. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
251 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
252 user |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
253 Initially holding the "admin" user, will eventually have an entry for all |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
254 users using roundup. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
255 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
256 msg |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
257 Initially empty, will all e-mail messages sent to or generated by |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
258 roundup. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
259 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
260 file |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
261 Initially empty, will all files attached to issues. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
262 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
263 issue |
| 1091 | 264 Initially empty, this is where the issue information is stored. |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
265 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
266 We define the "priority" and "status" classes to allow two things: reduction in |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
267 the amount of information stored on the issue and more powerful, accurate |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
268 searching of issues by priority and status. By only requiring a link on the |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
269 issue (which is stored as a single number) we reduce the chance that someone |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
270 mis-types a priority or status - or simply makes a new one up. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
271 |
| 1091 | 272 Class and Items |
| 1098 | 273 ~~~~~~~~~~~~~~~ |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
274 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
275 A Class defines a particular class (or type) of data that will be stored in the |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
276 database. A class comprises one or more properties, which given the information |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
277 about the class items. |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
278 The actual data entered into the database, using class.create() are called |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
279 items. They have a special immutable property called id. We sometimes refer to |
|
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
280 this as the itemid. |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
281 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
282 Properties |
| 1098 | 283 ~~~~~~~~~~ |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
284 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
285 A Class is comprised of one or more properties of the following types: |
| 1091 | 286 |
| 287 * String properties are for storing arbitrary-length strings. | |
| 288 * Password properties are for storing encoded arbitrary-length strings. The | |
| 289 default encoding is defined on the roundup.password.Password class. | |
| 290 * Date properties store date-and-time stamps. Their values are Timestamp | |
| 291 objects. | |
| 292 * Number properties store numeric values. | |
| 293 * Boolean properties store on/off, yes/no, true/false values. | |
| 294 * A Link property refers to a single other item selected from a specified | |
| 295 class. The class is part of the property; the value is an integer, the id | |
| 296 of the chosen item. | |
| 297 * A Multilink property refers to possibly many items in a specified class. | |
| 298 The value is a list of integers. | |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
299 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
300 FileClass |
| 1098 | 301 ~~~~~~~~~ |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
302 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
303 FileClasses save their "content" attribute off in a separate file from the rest |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
304 of the database. This reduces the number of large entries in the database, |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
305 which generally makes databases more efficient, and also allows us to use |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
306 command-line tools to operate on the files. They are stored in the files sub- |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
307 directory of the db directory in your tracker. |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
308 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
309 IssueClass |
| 1098 | 310 ~~~~~~~~~~ |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
311 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
312 IssueClasses automatically include the "messages", "files", "nosy", and |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
313 "superseder" properties. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
314 The messages and files properties list the links to the messages and files |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
315 related to the issue. The nosy property is a list of links to users who wish to |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
316 be informed of changes to the issue - they get "CC'ed" e-mails when messages |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
317 are sent to or generated by the issue. The nosy reactor (in the detectors |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
318 directory) handles this action. The superceder link indicates an issue which |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
319 has superceded this one. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
320 They also have the dynamically generated "creation", "activity" and "creator" |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
321 properties. |
| 1091 | 322 The value of the "creation" property is the date when an item was created, and |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
323 the value of the "activity" property is the date when any property on the item |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
324 was last edited (equivalently, these are the dates on the first and last |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
325 records in the item's journal). The "creator" property holds a link to the user |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
326 that created the issue. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
327 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
328 setkey(property) |
| 1098 | 329 ~~~~~~~~~~~~~~~~ |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
330 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
331 Select a String property of the class to be the key property. The key property |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
332 muse be unique, and allows references to the items in the class by the content |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
333 of the key property. That is, we can refer to users by their username, e.g. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
334 let's say that there's an issue in roundup, issue 23. There's also a user, |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
335 richard who happens to be user 2. To assign an issue to him, we could do either |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
336 of:: |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
337 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
338 roundup-admin set issue assignedto=2 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
339 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
340 or:: |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
341 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
342 roundup-admin set issue assignedto=richard |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
343 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
344 Note, the same thing can be done in the web and e-mail interfaces. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
345 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
346 create(information) |
| 1098 | 347 ~~~~~~~~~~~~~~~~~~~ |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
348 |
| 1091 | 349 Create an item in the database. This is generally used to create items in the |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
350 "definitional" classes like "priority" and "status". |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
351 |
|
684
5b23ff865f3a
added a "detectors" directory...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
352 |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
353 Examples of adding to your schema |
| 1098 | 354 --------------------------------- |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
355 |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
356 TODO |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
357 |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
358 |
|
684
5b23ff865f3a
added a "detectors" directory...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
359 Detectors - adding behaviour to your tracker |
| 1098 | 360 ============================================ |
|
909
ef9c759c243e
Fix to hasPermission, thanks Stefan Seefeld.
Richard Jones <richard@users.sourceforge.net>
parents:
907
diff
changeset
|
361 .. _detectors: |
|
684
5b23ff865f3a
added a "detectors" directory...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
362 |
| 1164 | 363 Detectors are initialised every time you open your tracker database, so you're |
| 364 free to add and remove them any time, even after the database is initliased | |
| 365 via the "roundup-admin initalise" command. | |
| 366 | |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
367 The detectors in your tracker fire before (*auditors*) and after (*reactors*) |
|
907
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
368 changes to the contents of your database. They are Python modules that sit in |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
369 your tracker's ``detectors`` directory. You will have some installed by |
|
907
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
370 default - have a look. You can write new detectors or modify the existing |
|
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
371 ones. The existing detectors installed for you are: |
|
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
372 |
|
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
373 **nosyreaction.py** |
|
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
374 This provides the automatic nosy list maintenance and email sending. The nosy |
|
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
375 reactor (``nosyreaction``) fires when new messages are added to issues. |
|
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
376 The nosy auditor (``updatenosy``) fires when issues are changed and figures |
|
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
377 what changes need to be made to the nosy list (like adding new authors etc) |
|
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
378 **statusauditor.py** |
|
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
379 This provides the ``chatty`` auditor which changes the issue status from |
|
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
380 ``unread`` or ``closed`` to ``chatting`` if new messages appear. It also |
|
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
381 provides the ``presetunread`` auditor which pre-sets the status to |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
382 ``unread`` on new items if the status isn't explicitly defined. |
|
907
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
383 |
|
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
384 See the detectors section in the `design document`__ for details of the |
|
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
385 interface for detectors. |
|
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
386 |
|
909
ef9c759c243e
Fix to hasPermission, thanks Stefan Seefeld.
Richard Jones <richard@users.sourceforge.net>
parents:
907
diff
changeset
|
387 __ design.html |
|
907
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
388 |
|
684
5b23ff865f3a
added a "detectors" directory...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
389 Sample additional detectors that have been found useful will appear in the |
|
5b23ff865f3a
added a "detectors" directory...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
390 ``detectors`` directory of the Roundup distribution: |
|
5b23ff865f3a
added a "detectors" directory...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
391 |
|
907
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
392 **newissuecopy.py** |
|
684
5b23ff865f3a
added a "detectors" directory...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
393 This detector sends an email to a team address whenever a new issue is |
|
5b23ff865f3a
added a "detectors" directory...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
394 created. The address is hard-coded into the detector, so edit it before you |
|
5b23ff865f3a
added a "detectors" directory...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
395 use it (look for the text 'team@team.host') or you'll get email errors! |
|
5b23ff865f3a
added a "detectors" directory...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
396 |
| 1100 | 397 The detector code:: |
| 398 | |
| 399 from roundup import roundupdb | |
| 400 | |
| 401 def newissuecopy(db, cl, nodeid, oldvalues): | |
| 402 ''' Copy a message about new issues to a team address. | |
| 403 ''' | |
| 404 # so use all the messages in the create | |
| 405 change_note = cl.generateCreateNote(nodeid) | |
| 406 | |
| 407 # send a copy to the nosy list | |
| 408 for msgid in cl.get(nodeid, 'messages'): | |
| 409 try: | |
| 410 # note: last arg must be a list | |
| 411 cl.send_message(nodeid, msgid, change_note, ['team@team.host']) | |
| 412 except roundupdb.MessageSendError, message: | |
| 413 raise roundupdb.DetectorError, message | |
| 414 | |
| 415 def init(db): | |
| 416 db.issue.react('create', newissuecopy) | |
| 1091 | 417 |
|
684
5b23ff865f3a
added a "detectors" directory...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
418 |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
419 Database Content |
| 1098 | 420 ================ |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
421 |
|
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
422 Note: if you modify the content of definitional classes, you'll most likely |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
423 need to edit the tracker `detectors`_ to reflect your changes. |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
424 |
|
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
425 Customisation of the special "definitional" classes (eg. status, priority, |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
426 resolution, ...) may be done either before or after the tracker is |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
427 initialised. The actual method of doing so is completely different in each |
|
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
428 case though, so be careful to use the right one. |
|
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
429 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
430 **Changing content before tracker initialisation** |
|
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
431 Edit the dbinit module in your tracker to alter the items created in using |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
432 the create() methods. |
|
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
433 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
434 **Changing content after tracker initialisation** |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
435 Use the roundup-admin interface's create, set and retire methods to add, |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
436 alter or remove items from the classes in question. |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
437 |
| 1091 | 438 XXX example |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
439 |
|
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
440 |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
441 Web Interface |
| 1098 | 442 ============= |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
443 |
| 1125 | 444 .. contents:: |
| 445 :local: | |
| 446 :depth: 1 | |
| 447 | |
| 1091 | 448 The web is provided by the roundup.cgi.client module and is used by |
| 449 roundup.cgi, roundup-server and ZRoundup. | |
| 450 In all cases, we determine which tracker is being accessed | |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
451 (the first part of the URL path inside the scope of the CGI handler) and pass |
| 1091 | 452 control on to the tracker interfaces.Client class - which uses the Client class |
| 453 from roundup.cgi.client - which handles the rest of | |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
454 the access through its main() method. This means that you can do pretty much |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
455 anything you want as a web interface to your tracker. |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
456 |
| 1091 | 457 Repurcussions of changing the tracker schema |
| 1098 | 458 --------------------------------------------- |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
459 |
| 1091 | 460 If you choose to change the `tracker schema`_ you will need to ensure the web |
| 461 interface knows about it: | |
| 462 | |
| 463 1. Index, item and search pages for the relevant classes may need to have | |
| 464 properties added or removed, | |
| 465 2. The "page" template may require links to be changed, as might the "home" | |
| 466 page's content arguments. | |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
467 |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
468 How requests are processed |
| 1098 | 469 -------------------------- |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
470 |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
471 The basic processing of a web request proceeds as follows: |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
472 |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
473 1. figure out who we are, defaulting to the "anonymous" user |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
474 2. figure out what the request is for - we call this the "context" |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
475 3. handle any requested action (item edit, search, ...) |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
476 4. render a template, resulting in HTML output |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
477 |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
478 In some situations, exceptions occur: |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
479 |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
480 - HTTP Redirect (generally raised by an action) |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
481 - SendFile (generally raised by determine_context) |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
482 here we serve up a FileClass "content" property |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
483 - SendStaticFile (generally raised by determine_context) |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
484 here we serve up a file from the tracker "html" directory |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
485 - Unauthorised (generally raised by an action) |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
486 here the action is cancelled, the request is rendered and an error |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
487 message is displayed indicating that permission was not |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
488 granted for the action to take place |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
489 - NotFound (raised wherever it needs to be) |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
490 this exception percolates up to the CGI interface that called the client |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
491 |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
492 Determining web context |
| 1098 | 493 ----------------------- |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
494 |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
495 To determine the "context" of a request, we look at the URL and the special |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
496 request variable ``:template``. The URL path after the tracker identifier |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
497 is examined. Typical URL paths look like: |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
498 |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
499 1. ``/tracker/issue`` |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
500 2. ``/tracker/issue1`` |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
501 3. ``/tracker/_file/style.css`` |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
502 4. ``/cgi-bin/roundup.cgi/tracker/file1`` |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
503 5. ``/cgi-bin/roundup.cgi/tracker/file1/kitten.png`` |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
504 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
505 where the "tracker identifier" is "tracker" in the above cases. That means |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
506 we're looking at "issue", "issue1", "_file/style.css", "file1" and |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
507 "file1/kitten.png" in the cases above. The path is generally only one |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
508 entry long - longer paths are handled differently. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
509 |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
510 a. if there is no path, then we are in the "home" context. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
511 b. if the path starts with "_file" (as in example 3, |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
512 "/tracker/_file/style.css"), then the additional path entry, |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
513 "style.css" specifies the filename of a static file we're to serve up |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
514 from the tracker "html" directory. Raises a SendStaticFile |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
515 exception. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
516 c. if there is something in the path (as in example 1, "issue"), it identifies |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
517 the tracker class we're to display. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
518 d. if the path is an item designator (as in examples 2 and 4, "issue1" and |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
519 "file1"), then we're to display a specific item. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
520 e. if the path starts with an item designator and is longer than |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
521 one entry (as in example 5, "file1/kitten.png"), then we're assumed |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
522 to be handling an item of a |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
523 FileClass, and the extra path information gives the filename |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
524 that the client is going to label the download with (ie |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
525 "file1/kitten.png" is nicer to download than "file1"). This |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
526 raises a SendFile exception. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
527 |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
528 Both b. and e. stop before we bother to |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
529 determine the template we're going to use. That's because they |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
530 don't actually use templates. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
531 |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
532 The template used is specified by the ``:template`` CGI variable, |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
533 which defaults to: |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
534 |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
535 - only classname suplied: "index" |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
536 - full item designator supplied: "item" |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
537 |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
538 |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
539 Performing actions in web requests |
| 1098 | 540 ---------------------------------- |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
541 |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
542 When a user requests a web page, they may optionally also request for an |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
543 action to take place. As described in `how requests are processed`_, the |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
544 action is performed before the requested page is generated. Actions are |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
545 triggered by using a ``:action`` CGI variable, where the value is one of: |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
546 |
| 1125 | 547 **login** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
548 Attempt to log a user in. |
| 1125 | 549 **logout** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
550 Log the user out - make them "anonymous". |
| 1125 | 551 **register** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
552 Attempt to create a new user based on the contents of the form and then log |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
553 them in. |
| 1125 | 554 **edit** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
555 Perform an edit of an item in the database. There are some special form |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
556 elements you may use: |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
557 |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
558 :link=designator:property and :multilink=designator:property |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
559 The value specifies an item designator and the property on that |
|
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
560 item to add _this_ item to as a link or multilink. |
|
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
561 :note |
|
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
562 Create a message and attach it to the current item's |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
563 "messages" property. |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
564 :file |
|
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
565 Create a file and attach it to the current item's |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
566 "files" property. Attach the file to the message created from |
| 1091 | 567 the :note if it's supplied. |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
568 :required=property,property,... |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
569 The named properties are required to be filled in the form. |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
570 |
| 1125 | 571 **new** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
572 Add a new item to the database. You may use the same special form elements |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
573 as in the "edit" action. |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
574 |
| 1125 | 575 **editCSV** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
576 Performs an edit of all of a class' items in one go. See also the |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
577 *class*.csv templating method which generates the CSV data to be edited, and |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
578 the "_generic.index" template which uses both of these features. |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
579 |
| 1125 | 580 **search** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
581 Mangle some of the form variables. |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
582 |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
583 Set the form ":filter" variable based on the values of the |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
584 filter variables - if they're set to anything other than |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
585 "dontcare" then add them to :filter. |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
586 |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
587 Also handle the ":queryname" variable and save off the query to |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
588 the user's query list. |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
589 |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
590 Each of the actions is implemented by a corresponding *actionAction* (where |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
591 "action" is the name of the action) method on |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
592 the roundup.cgi.Client class, which also happens to be in your tracker as |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
593 interfaces.Client. So if you need to define new actions, you may add them |
| 1098 | 594 there (see `defining new web actions`_). |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
595 |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
596 Each action also has a corresponding *actionPermission* (where |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
597 "action" is the name of the action) method which determines |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
598 whether the action is permissible given the current user. The base permission |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
599 checks are: |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
600 |
| 1125 | 601 **login** |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
602 Determine whether the user has permission to log in. |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
603 Base behaviour is to check the user has "Web Access". |
| 1125 | 604 **logout** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
605 No permission checks are made. |
| 1125 | 606 **register** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
607 Determine whether the user has permission to register |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
608 Base behaviour is to check the user has "Web Registration". |
| 1125 | 609 **edit** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
610 Determine whether the user has permission to edit this item. |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
611 Base behaviour is to check the user can edit this class. If we're |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
612 editing the "user" class, users are allowed to edit their own |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
613 details. Unless it's the "roles" property, which requires the |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
614 special Permission "Web Roles". |
| 1125 | 615 **new** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
616 Determine whether the user has permission to create (edit) this item. |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
617 Base behaviour is to check the user can edit this class. No |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
618 additional property checks are made. Additionally, new user items |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
619 may be created if the user has the "Web Registration" Permission. |
| 1125 | 620 **editCSV** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
621 Determine whether the user has permission to edit this class. |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
622 Base behaviour is to check the user can edit this class. |
| 1125 | 623 **search** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
624 Determine whether the user has permission to search this class. |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
625 Base behaviour is to check the user can view this class. |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
626 |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
627 |
| 1091 | 628 Default templates |
| 1098 | 629 ----------------- |
| 1091 | 630 |
| 631 Most customisation of the web view can be done by modifying the templates in | |
| 632 the tracker **html** directory. There are several types of files in there: | |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
633 |
| 1125 | 634 **page** |
| 1100 | 635 This template defines the overall look of your tracker. When you |
| 1091 | 636 view an issue, it appears inside this template. When you view an index, it |
| 1100 | 637 also appears inside this template. It will have a ``tal:content`` or |
| 638 ``tal:replace`` command with the expression ``structure content`` which | |
| 639 will show the issue, list of issues or whatever. | |
| 1125 | 640 **home** |
| 1091 | 641 the default page displayed when no other page is indicated by the user |
| 1125 | 642 **home.classlist** |
| 1091 | 643 a special version of the default page that lists the classes in the tracker |
| 1125 | 644 **classname.item** |
| 1091 | 645 displays an item of the *classname* class |
| 1125 | 646 **classname.index** |
| 1091 | 647 displays a list of *classname* items |
| 1125 | 648 **classname.search** |
| 1091 | 649 displays a search page for *classname* items |
| 1125 | 650 **_generic.index** |
| 1091 | 651 used to display a list of items where there is no *classname*.index available |
| 1125 | 652 **_generic.help** |
| 1091 | 653 used to display a "class help" page where there is no *classname*.help |
| 1125 | 654 **user.register** |
| 1091 | 655 a special page just for the user class that renders the registration page |
| 1125 | 656 **style.css** |
| 1091 | 657 a static file that is served up as-is |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
658 |
| 1148 | 659 Note: Remember that you can create any template extension you want to, so |
|
1147
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
660 if you just want to play around with the templating for new issues, you can |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
661 copy the current "issue.item" template to "issue.test", and then access the |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
662 test template using the ":template" URL argument:: |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
663 |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
664 http://your.tracker.example/tracker/issue?:template=test |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
665 |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
666 and it won't affect your users using the "issue.item" template. |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
667 |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
668 |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
669 How the templates work |
| 1098 | 670 ---------------------- |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
671 |
| 1083 | 672 Roundup's templates consist of special attributes on your template tags. These |
| 673 attributes form the Template Attribute Language, or TAL. The commands are: | |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
674 |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
675 |
| 1125 | 676 **tal:define="variable expression; variable expression; ..."** |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
677 Define a new variable that is local to this tag and its contents. For |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
678 example:: |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
679 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
680 <html tal:define="title request/description"> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
681 <head><title tal:content="title"></title></head> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
682 </html> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
683 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
684 In the example, the variable "title" is defined as being the result of the |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
685 expression "request/description". The tal:content command inside the <html> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
686 tag may then use the "title" variable. |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
687 |
| 1125 | 688 **tal:condition="expression"** |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
689 Only keep this tag and its contents if the expression is true. For example:: |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
690 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
691 <p tal:condition="python:request.user.hasPermission('View', 'issue')"> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
692 Display some issue information. |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
693 </p> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
694 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
695 In the example, the <p> tag and its contents are only displayed if the |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
696 user has the View permission for issues. We consider the number zero, a |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
697 blank string, an empty list, and the built-in variable nothing to be false |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
698 values. Nearly every other value is true, including non-zero numbers, and |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
699 strings with anything in them (even spaces!). |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
700 |
| 1125 | 701 **tal:repeat="variable expression"** |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
702 Repeat this tag and its contents for each element of the sequence that the |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
703 expression returns, defining a new local variable and a special "repeat" |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
704 variable for each element. For example:: |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
705 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
706 <tr tal:repeat="u user/list"> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
707 <td tal:content="u/id"></td> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
708 <td tal:content="u/username"></td> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
709 <td tal:content="u/realname"></td> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
710 </tr> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
711 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
712 The example would iterate over the sequence of users returned by |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
713 "user/list" and define the local variable "u" for each entry. |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
714 |
| 1125 | 715 **tal:replace="expression"** |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
716 Replace this tag with the result of the expression. For example:: |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
717 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
718 <span tal:replace="request/user/realname"></span> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
719 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
720 The example would replace the <span> tag and its contents with the user's |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
721 realname. If the user's realname was "Bruce" then the resultant output |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
722 would be "Bruce". |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
723 |
| 1125 | 724 **tal:content="expression"** |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
725 Replace the contents of this tag with the result of the expression. For |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
726 example:: |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
727 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
728 <span tal:content="request/user/realname">user's name appears here</span> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
729 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
730 The example would replace the contents of the <span> tag with the user's |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
731 realname. If the user's realname was "Bruce" then the resultant output |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
732 would be "<span>Bruce</span>". |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
733 |
| 1125 | 734 **tal:attributes="attribute expression; attribute expression; ..."** |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
735 Set attributes on this tag to the results of expressions. For example:: |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
736 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
737 <a tal:attributes="href string:user${request/user/id}">My Details</a> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
738 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
739 In the example, the "href" attribute of the <a> tag is set to the value of |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
740 the "string:user${request/user/id}" expression, which will be something |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
741 like "user123". |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
742 |
| 1125 | 743 **tal:omit-tag="expression"** |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
744 Remove this tag (but not its contents) if the expression is true. For |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
745 example:: |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
746 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
747 <span tal:omit-tag="python:1">Hello, world!</span> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
748 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
749 would result in output of:: |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
750 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
751 Hello, world! |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
752 |
| 1083 | 753 Note that the commands on a given tag are evaulated in the order above, so |
| 754 *define* comes before *condition*, and so on. | |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
755 |
| 1083 | 756 Additionally, a tag is defined, tal:block, which is removed from output. Its |
| 757 content is not, but the tag itself is (so don't go using any tal:attributes | |
| 758 commands on it). This is useful for making arbitrary blocks of HTML | |
| 759 conditional or repeatable (very handy for repeating multiple table rows, | |
| 760 which would othewise require an illegal tag placement to effect the repeat). | |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
761 |
| 1083 | 762 The expressions you may use in the attibute values may be one of the following |
| 763 three forms: | |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
764 |
| 1125 | 765 **Path Expressions** - eg. ``item/status/checklist`` |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
766 These are object attribute / item accesses. Roughly speaking, the path |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
767 ``item/status/checklist`` is broken into parts ``item``, ``status`` |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
768 and ``checklist``. The ``item`` part is the root of the expression. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
769 We then look for a ``status`` attribute on ``item``, or failing that, a |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
770 ``status`` item (as in ``item['status']``). If that |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
771 fails, the path expression fails. When we get to the end, the object we're |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
772 left with is evaluated to get a string - methods are called, objects are |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
773 stringified. Path expressions may have an optional ``path:`` prefix, though |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
774 they are the default expression type, so it's not necessary. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
775 |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
776 XXX | components of expressions |
| 1083 | 777 |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
778 XXX "nothing" and "default" |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
779 |
| 1125 | 780 **String Expressions** - eg. ``string:hello ${user/name}`` |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
781 These expressions are simple string interpolations (though they can be just |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
782 plain strings with no interpolation if you want. The expression in the |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
783 ``${ ... }`` is just a path expression as above. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
784 |
| 1125 | 785 **Python Expressions** - eg. ``python: 1+1`` |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
786 These expressions give the full power of Python. All the "root level" |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
787 variables are available, so ``python:item.status.checklist()`` would be |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
788 equivalent to ``item/status/checklist``, assuming that ``checklist`` is |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
789 a method. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
790 |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
791 Information available to templates |
| 1098 | 792 ---------------------------------- |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
793 |
| 1125 | 794 Note: this is implemented by roundup.cgi.templating.RoundupPageTemplate |
| 795 | |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
796 The following variables are available to templates. |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
797 |
| 1125 | 798 **context** |
|
1123
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
799 The current context. This is either None, a |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
800 `hyperdb class wrapper`_ or a `hyperdb item wrapper`_ |
| 1125 | 801 **request** |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
802 Includes information about the current request, including: |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
803 - the url |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
804 - the current index information (``filterspec``, ``filter`` args, |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
805 ``properties``, etc) parsed out of the form. |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
806 - methods for easy filterspec link generation |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
807 - *user*, the current user item as an HTMLItem instance |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
808 - *form* |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
809 The current CGI form information as a mapping of form argument |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
810 name to value |
| 1125 | 811 **tracker** |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
812 The current tracker |
| 1125 | 813 **db** |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
814 The current database, through which db.config may be reached. |
| 1125 | 815 **nothing** |
| 1100 | 816 This is a special variable - if an expression evaluates to this, then the |
| 817 tag (in the case of a tal:replace), its contents (in the case of | |
| 818 tal:content) or some attributes (in the case of tal:attributes) will not | |
| 819 appear in the the output. So for example:: | |
| 820 | |
| 821 <span tal:attributes="class nothing">Hello, World!</span> | |
| 822 | |
| 823 would result in:: | |
| 824 | |
| 825 <span>Hello, World!</span> | |
| 826 | |
| 1125 | 827 **default** |
| 1100 | 828 Also a special variable - if an expression evaluates to this, then the |
| 829 existing HTML in the template will not be replaced or removed, it will | |
| 830 remain. So:: | |
| 831 | |
| 832 <span tal:replace="default">Hello, World!</span> | |
| 833 | |
| 834 would result in:: | |
| 835 | |
| 836 <span>Hello, World!</span> | |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
837 |
| 1125 | 838 **utils** |
|
1123
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
839 This variable makes available some utility functions like batching. |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
840 |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
841 The context variable |
| 1098 | 842 ~~~~~~~~~~~~~~~~~~~~ |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
843 |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
844 The *context* variable is one of three things based on the current context |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
845 (see `determining web context`_ for how we figure this out): |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
846 |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
847 1. if we're looking at a "home" page, then it's None |
|
1123
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
848 2. if we're looking at a specific hyperdb class, it's a |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
849 `hyperdb class wrapper`_. |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
850 3. if we're looking at a specific hyperdb item, it's a |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
851 `hyperdb item wrapper`_. |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
852 |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
853 If the context is not None, we can access the properties of the class or item. |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
854 The only real difference between cases 2 and 3 above are: |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
855 |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
856 1. the properties may have a real value behind them, and this will appear if |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
857 the property is displayed through ``context/property`` or |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
858 ``context/property/field``. |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
859 2. the context's "id" property will be a false value in the second case, but |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
860 a real, or true value in the third. Thus we can determine whether we're |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
861 looking at a real item from the hyperdb by testing "context/id". |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
862 |
|
1123
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
863 Hyperdb class wrapper |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
864 ::::::::::::::::::::: |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
865 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
866 Note: this is implemented by the roundup.cgi.templating.HTMLClass class. |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
867 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
868 This wrapper object provides access to a hyperb class. It is used primarily |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
869 in both index view and new item views, but it's also usable anywhere else that |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
870 you wish to access information about a class, or the items of a class, when |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
871 you don't have a specific item of that class in mind. |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
872 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
873 We allow access to properties. There will be no "id" property. The value |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
874 accessed through the property will be the current value of the same name from |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
875 the CGI form. |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
876 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
877 There are several methods available on these wrapper objects: |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
878 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
879 =========== ============================================================= |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
880 Method Description |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
881 =========== ============================================================= |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
882 properties return a `hyperdb property wrapper`_ for all of this class' |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
883 properties. |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
884 list lists all of the active (not retired) items in the class. |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
885 csv return the items of this class as a chunk of CSV text. |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
886 propnames lists the names of the properties of this class. |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
887 filter lists of items from this class, filtered and sorted |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
888 by the current *request* filterspec/filter/sort/group args |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
889 classhelp display a link to a javascript popup containing this class' |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
890 "help" template. |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
891 submit generate a submit button (and action hidden element) |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
892 renderWith render this class with the given template. |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
893 history returns 'New node - no history' :) |
|
1136
7e193bbda38e
added generic item editing
Richard Jones <richard@users.sourceforge.net>
parents:
1133
diff
changeset
|
894 is_edit_ok is the user allowed to Edit the current class? |
|
7e193bbda38e
added generic item editing
Richard Jones <richard@users.sourceforge.net>
parents:
1133
diff
changeset
|
895 is_view_ok is the user allowed to View the current class? |
|
1123
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
896 =========== ============================================================= |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
897 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
898 Note that if you have a property of the same name as one of the above methods, |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
899 you'll need to access it using a python "item access" expression. For example:: |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
900 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
901 python:context['list'] |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
902 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
903 will access the "list" property, rather than the list method. |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
904 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
905 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
906 Hyperdb item wrapper |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
907 :::::::::::::::::::: |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
908 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
909 Note: this is implemented by the roundup.cgi.templating.HTMLItem class. |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
910 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
911 This wrapper object provides access to a hyperb item. |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
912 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
913 We allow access to properties. There will be no "id" property. The value |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
914 accessed through the property will be the current value of the same name from |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
915 the CGI form. |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
916 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
917 There are several methods available on these wrapper objects: |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
918 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
919 =============== ============================================================= |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
920 Method Description |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
921 =============== ============================================================= |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
922 submit generate a submit button (and action hidden element) |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
923 journal return the journal of the current item (**not implemented**) |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
924 history render the journal of the current item as HTML |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
925 renderQueryForm specific to the "query" class - render the search form for |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
926 the query |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
927 hasPermission specific to the "user" class - determine whether the user |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
928 has a Permission |
|
1136
7e193bbda38e
added generic item editing
Richard Jones <richard@users.sourceforge.net>
parents:
1133
diff
changeset
|
929 is_edit_ok is the user allowed to Edit the current item? |
|
7e193bbda38e
added generic item editing
Richard Jones <richard@users.sourceforge.net>
parents:
1133
diff
changeset
|
930 is_view_ok is the user allowed to View the current item? |
|
1123
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
931 =============== ============================================================= |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
932 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
933 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
934 Note that if you have a property of the same name as one of the above methods, |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
935 you'll need to access it using a python "item access" expression. For example:: |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
936 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
937 python:context['journal'] |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
938 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
939 will access the "journal" property, rather than the journal method. |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
940 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
941 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
942 Hyperdb property wrapper |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
943 :::::::::::::::::::::::: |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
944 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
945 Note: this is implemented by subclasses roundup.cgi.templating.HTMLProperty |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
946 class (HTMLStringProperty, HTMLNumberProperty, and so on). |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
947 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
948 This wrapper object provides access to a single property of a class. Its |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
949 value may be either: |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
950 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
951 1. if accessed through a `hyperdb item wrapper`_, then it's a value from the |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
952 hyperdb |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
953 2. if access through a `hyperdb class wrapper`_, then it's a value from the |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
954 CGI form |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
955 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
956 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
957 The property wrapper has some useful attributes: |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
958 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
959 =============== ============================================================= |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
960 Attribute Description |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
961 =============== ============================================================= |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
962 _name the name of the property |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
963 _value the value of the property if any |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
964 =============== ============================================================= |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
965 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
966 There are several methods available on these wrapper objects: |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
967 |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
968 =========== ================================================================= |
|
1123
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
969 Method Description |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
970 =========== ================================================================= |
|
1123
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
971 plain render a "plain" representation of the property |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
972 field render a form edit field for the property |
|
1124
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
973 stext only on String properties - render the value of the |
|
1123
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
974 property as StructuredText (requires the StructureText module |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
975 to be installed separately) |
|
1124
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
976 multiline only on String properties - render a multiline form edit |
|
1123
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
977 field for the property |
|
1124
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
978 email only on String properties - render the value of the |
|
1123
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
979 property as an obscured email address |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
980 confirm only on Password properties - render a second form edit field for |
|
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
981 the property, used for confirmation that the user typed the |
|
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
982 password correctly. Generates a field with name "name:confirm". |
|
1124
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
983 reldate only on Date properties - render the interval between the |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
984 date and now |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
985 pretty only on Interval properties - render the interval in a |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
986 pretty format (eg. "yesterday") |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
987 menu only on Link and Multilink properties - render a form select |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
988 list for this property |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
989 reverse only on Multilink properties - produce a list of the linked |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
990 items in reverse order |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
991 =========== ================================================================= |
|
1123
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
992 |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
993 The request variable |
| 1098 | 994 ~~~~~~~~~~~~~~~~~~~~ |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
995 |
|
1123
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
996 Note: this is implemented by the roundup.cgi.templating.HTMLRequest class. |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
997 |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
998 The request variable is packed with information about the current request. |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
999 |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1000 .. taken from roundup.cgi.templating.HTMLRequest docstring |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1001 |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
1002 =========== ================================================================= |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1003 Variable Holds |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
1004 =========== ================================================================= |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1005 form the CGI form as a cgi.FieldStorage |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1006 env the CGI environment variables |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1007 url the current URL path for this request |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
1008 base the base URL for this tracker |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1009 user a HTMLUser instance for this user |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1010 classname the current classname (possibly None) |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1011 template the current template (suffix, also possibly None) |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1012 form the current CGI form variables in a FieldStorage |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
1013 =========== ================================================================= |
| 1083 | 1014 |
| 1015 **Index page specific variables (indexing arguments)** | |
| 1016 | |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
1017 =========== ================================================================= |
| 1083 | 1018 Variable Holds |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
1019 =========== ================================================================= |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1020 columns dictionary of the columns to display in an index page |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1021 show a convenience access to columns - request/show/colname will |
| 1098 | 1022 be true if the columns should be displayed, false otherwise |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1023 sort index sort column (direction, column name) |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1024 group index grouping property (direction, column name) |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1025 filter properties to filter the index on |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1026 filterspec values to filter the index on |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1027 search_text text to perform a full-text search on for an index |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
1028 =========== ================================================================= |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1029 |
|
1124
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1030 There are several methods available on the request variable: |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1031 |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
1032 =============== ============================================================= |
|
1124
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1033 Method Description |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
1034 =============== ============================================================= |
|
1124
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1035 description render a description of the request - handle for the page |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1036 title |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1037 indexargs_form render the current index args as form elements |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1038 indexargs_url render the current index args as a URL |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1039 base_javascript render some javascript that is used by other components of |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1040 the templating |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1041 batch run the current index args through a filter and return a |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1042 list of items (see `hyperdb item wrapper`_, and |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1043 `batching`_) |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
1044 =============== ============================================================= |
|
1124
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1045 |
| 1142 | 1046 The form variable |
| 1047 ::::::::::::::::: | |
| 1048 | |
| 1049 The form variable is a little special because it's actually a python | |
| 1050 FieldStorage object. That means that you have two ways to access its | |
| 1051 contents. For example, to look up the CGI form value for the variable | |
| 1052 "name", use the path expression:: | |
| 1053 | |
| 1054 request/form/name/value | |
| 1055 | |
| 1056 or the python expression:: | |
| 1057 | |
| 1058 python:request.form['name'].value | |
| 1059 | |
| 1060 Note the "item" access used in the python case, and also note the explicit | |
| 1061 "value" attribute we have to access. That's because the form variables are | |
| 1062 stored as MiniFieldStorages. If there's more than one "name" value in | |
| 1063 the form, then the above will break since ``request/form/name`` is actually a | |
| 1064 *list* of MiniFieldStorages. So it's best to know beforehand what you're | |
| 1065 dealing with. | |
| 1066 | |
| 1067 | |
|
1123
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1068 The db variable |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1069 ~~~~~~~~~~~~~~~ |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1070 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1071 Note: this is implemented by the roundup.cgi.templating.HTMLDatabase class. |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1072 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1073 Allows access to all hyperdb classes as attributes of this variable. If you |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1074 want access to the "user" class, for example, you would use:: |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1075 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1076 db/user |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1077 python:db.user |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1078 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1079 The access results in a `hyperdb class wrapper`_. |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1080 |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1081 |
|
1124
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1082 The util variable |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1083 ~~~~~~~~~~~~~~~~~ |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1084 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1085 Note: this is implemented by the roundup.cgi.templating.TemplatingUtils class. |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1086 |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
1087 =============== ============================================================= |
|
1124
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1088 Method Description |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
1089 =============== ============================================================= |
|
1124
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1090 Batch return a batch object using the supplied list |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
1091 =============== ============================================================= |
|
1124
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1092 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1093 Batching |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1094 :::::::: |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1095 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1096 Use Batch to turn a list of items, or item ids of a given class, into a series |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1097 of batches. Its usage is:: |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1098 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1099 python:util.Batch(sequence, size, start, end=0, orphan=0, overlap=0) |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1100 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1101 or, to get the current index batch:: |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1102 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1103 request/batch |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1104 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1105 The parameters are: |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1106 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1107 ========= ================================================================== |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1108 Parameter Usage |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1109 ========= ================================================================== |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1110 sequence a list of HTMLItems |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1111 size how big to make the sequence. |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1112 start where to start (0-indexed) in the sequence. |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1113 end where to end (0-indexed) in the sequence. |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1114 orphan if the next batch would contain less items than this |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1115 value, then it is combined with this batch |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1116 overlap the number of items shared between adjacent batches |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1117 ========= ================================================================== |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1118 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1119 All of the parameters are assigned as attributes on the batch object. In |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1120 addition, it has several more attributes: |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1121 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1122 =============== ============================================================ |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1123 Attribute Description |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1124 =============== ============================================================ |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1125 start indicates the start index of the batch. *Note: unlike the |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1126 argument, is a 1-based index (I know, lame)* |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1127 first indicates the start index of the batch *as a 0-based |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1128 index* |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1129 length the actual number of elements in the batch |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1130 sequence_length the length of the original, unbatched, sequence. |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1131 =============== ============================================================ |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1132 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1133 And several methods: |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1134 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1135 =============== ============================================================ |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1136 Method Description |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1137 =============== ============================================================ |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1138 previous returns a new Batch with the previous batch settings |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1139 next returns a new Batch with the next batch settings |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1140 propchanged detect if the named property changed on the current item |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1141 when compared to the last item |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1142 =============== ============================================================ |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1143 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1144 An example of batching:: |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1145 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1146 <table class="otherinfo"> |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1147 <tr><th colspan="4" class="header">Existing Keywords</th></tr> |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1148 <tr tal:define="keywords db/keyword/list" |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1149 tal:repeat="start python:range(0, len(keywords), 4)"> |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1150 <td tal:define="batch python:utils.Batch(keywords, 4, start)" |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1151 tal:repeat="keyword batch" tal:content="keyword/name">keyword here</td> |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1152 </tr> |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1153 </table> |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1154 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1155 ... which will produce a table with four columns containing the items of the |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1156 "keyword" class (well, their "name" anyway). |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1157 |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1158 Displaying Properties |
| 1098 | 1159 --------------------- |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1160 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1161 Properties appear in the user interface in three contexts: in indices, in |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
1162 editors, and as search arguments. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
1163 For each type of property, there are several display possibilities. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
1164 For example, in an index view, a string property may just be |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
1165 printed as a plain string, but in an editor view, that property may be |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1166 displayed in an editable field. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1167 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1168 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1169 Index Views |
| 1098 | 1170 ----------- |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1171 |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1172 This is one of the class context views. It is also the default view for |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1173 classes. The template used is "*classname*.index". |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1174 |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1175 Index View Specifiers |
| 1098 | 1176 ~~~~~~~~~~~~~~~~~~~~~ |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1177 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1178 An index view specifier (URL fragment) looks like this (whitespace has been |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1179 added for clarity):: |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1180 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1181 /issue?status=unread,in-progress,resolved& |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1182 topic=security,ui& |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1183 :group=+priority& |
| 1098 | 1184 :sort==activity& |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1185 :filters=status,topic& |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1186 :columns=title,status,fixer |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1187 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1188 The index view is determined by two parts of the specifier: the layout part and |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1189 the filter part. The layout part consists of the query parameters that begin |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
1190 with colons, and it determines the way that the properties of selected items |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1191 are displayed. The filter part consists of all the other query parameters, and |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
1192 it determines the criteria by which items are selected for display. |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1193 The filter part is interactively manipulated with the form widgets displayed in |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1194 the filter section. The layout part is interactively manipulated by clicking on |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1195 the column headings in the table. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1196 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1197 The filter part selects the union of the sets of items with values matching any |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1198 specified Link properties and the intersection of the sets of items with values |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1199 matching any specified Multilink properties. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1200 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
1201 The example specifies an index of "issue" items. Only items with a "status" of |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1202 either "unread" or "in-progres" or "resolved" are displayed, and only items |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1203 with "topic" values including both "security" and "ui" are displayed. The items |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1204 are grouped by priority, arranged in ascending order; and within groups, sorted |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1205 by activity, arranged in descending order. The filter section shows filters for |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1206 the "status" and "topic" properties, and the table includes columns for the |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1207 "title", "status", and "fixer" properties. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1208 |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
1209 Filtering of indexes |
| 1098 | 1210 ~~~~~~~~~~~~~~~~~~~~ |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1211 |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
1212 TODO |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1213 |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
1214 Searching Views |
| 1098 | 1215 --------------- |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1216 |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1217 This is one of the class context views. The template used is typically |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1218 "*classname*.search". |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1219 |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
1220 TODO |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1221 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1222 Item Views |
| 1098 | 1223 ---------- |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1224 |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1225 The basic view of a hyperdb item is provided by the "*classname*.item" |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1226 template. It generally has three sections; an "editor", a "spool" and a |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1227 "history" section. |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1228 |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1229 |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1230 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1231 Editor Section |
| 1098 | 1232 ~~~~~~~~~~~~~~ |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1233 |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1234 The editor section is used to manipulate the item - it may be a |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1235 static display if the user doesn't have permission to edit the item. |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1236 |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1237 Here's an example of a basic editor template (this is the default "classic" |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1238 template issue item edit form - from the "issue.item" template):: |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1239 |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1240 <table class="form"> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1241 <tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1242 <th nowrap>Title</th> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1243 <td colspan=3 tal:content="structure python:context.title.field(size=60)">title</td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1244 </tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1245 |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1246 <tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1247 <th nowrap>Priority</th> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1248 <td tal:content="structure context/priority/menu">priority</td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1249 <th nowrap>Status</th> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1250 <td tal:content="structure context/status/menu">status</td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1251 </tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1252 |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1253 <tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1254 <th nowrap>Superseder</th> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1255 <td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1256 <span tal:replace="structure python:context.superseder.field(showid=1, size=20)" /> |
|
1113
a95428868bf4
Added the missing keyword/topic interface to classic template (blush)
Richard Jones <richard@users.sourceforge.net>
parents:
1100
diff
changeset
|
1257 <span tal:replace="structure python:db.issue.classhelp('id,title')" /> |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1258 <span tal:condition="context/superseder"> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1259 <br>View: <span tal:replace="structure python:context.superseder.link(showid=1)" /> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1260 </span> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1261 </td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1262 <th nowrap>Nosy List</th> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1263 <td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1264 <span tal:replace="structure context/nosy/field" /> |
|
1113
a95428868bf4
Added the missing keyword/topic interface to classic template (blush)
Richard Jones <richard@users.sourceforge.net>
parents:
1100
diff
changeset
|
1265 <span tal:replace="structure python:db.user.classhelp('username,realname,address,phone')" /> |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1266 </td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1267 </tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1268 |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1269 <tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1270 <th nowrap>Assigned To</th> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1271 <td tal:content="structure context/assignedto/menu"> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1272 assignedto menu |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1273 </td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1274 <td> </td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1275 <td> </td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1276 </tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1277 |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1278 <tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1279 <th nowrap>Change Note</th> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1280 <td colspan=3> |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
1281 <textarea name=":note" wrap="hard" rows="5" cols="60"></textarea> |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1282 </td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1283 </tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1284 |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1285 <tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1286 <th nowrap>File</th> |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
1287 <td colspan=3><input type="file" name=":file" size="40"></td> |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1288 </tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1289 |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1290 <tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1291 <td> </td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1292 <td colspan=3 tal:content="structure context/submit"> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1293 submit button will go here |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1294 </td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1295 </tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1296 </table> |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1297 |
|
673
604c84696461
link() htmltemplate function now has a "showid" option for links & multilinks.
Richard Jones <richard@users.sourceforge.net>
parents:
659
diff
changeset
|
1298 |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1299 When a change is submitted, the system automatically generates a message |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1300 describing the changed properties. As shown in the example, the editor |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
1301 template can use the ":note" and ":file" fields, which are added to the |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1302 standard change note message generated by Roundup. |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1303 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1304 Spool Section |
| 1098 | 1305 ~~~~~~~~~~~~~ |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1306 |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1307 The spool section lists related information like the messages and files of |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1308 an issue. |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1309 |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1310 TODO |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1311 |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1312 |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1313 History Section |
| 1098 | 1314 ~~~~~~~~~~~~~~~ |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1315 |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1316 The final section displayed is the history of the item - its database journal. |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1317 This is generally generated with the template:: |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1318 |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1319 <tal:block tal:replace="structure context/history" /> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1320 |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1321 *To be done:* |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1322 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
1323 *The actual history entries of the item may be accessed for manual templating |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1324 through the "journal" method of the item*:: |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1325 |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1326 <tal:block tal:repeat="entry context/journal"> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1327 a journal entry |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1328 </tal:block> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1329 |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1330 *where each journal entry is an HTMLJournalEntry.* |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1331 |
| 1098 | 1332 Defining new web actions |
| 1333 ------------------------ | |
| 1334 | |
| 1335 XXX | |
| 1336 | |
|
910
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1337 |
| 935 | 1338 Access Controls |
| 1098 | 1339 =============== |
|
910
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1340 |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1341 A set of Permissions are built in to the security module by default: |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1342 |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1343 - Edit (everything) |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1344 - View (everything) |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1345 |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1346 The default interfaces define: |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1347 |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1348 - Web Registration |
| 935 | 1349 - Web Access |
|
1003
f89b8d32291b
Hack hack hack...
Richard Jones <richard@users.sourceforge.net>
parents:
935
diff
changeset
|
1350 - Web Roles |
|
910
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1351 - Email Registration |
| 935 | 1352 - Email Access |
|
910
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1353 |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1354 These are hooked into the default Roles: |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1355 |
|
1003
f89b8d32291b
Hack hack hack...
Richard Jones <richard@users.sourceforge.net>
parents:
935
diff
changeset
|
1356 - Admin (Edit everything, View everything, Web Roles) |
| 935 | 1357 - User (Web Access, Email Access) |
|
910
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1358 - Anonymous (Web Registration, Email Registration) |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1359 |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1360 And finally, the "admin" user gets the "Admin" Role, and the "anonymous" user |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1361 gets the "Anonymous" assigned when the database is initialised on installation. |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1362 The two default schemas then define: |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1363 |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1364 - Edit issue, View issue (both) |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1365 - Edit file, View file (both) |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1366 - Edit msg, View msg (both) |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1367 - Edit support, View support (extended only) |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1368 |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1369 and assign those Permissions to the "User" Role. New users are assigned the |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1370 Roles defined in the config file as: |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1371 |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1372 - NEW_WEB_USER_ROLES |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1373 - NEW_EMAIL_USER_ROLES |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1374 |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1375 You may alter the configuration variables to change the Role that new web or |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1376 email users get, for example to not give them access to the web interface if |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1377 they register through email. |
|
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1378 |
| 935 | 1379 You may use the ``roundup-admin`` "``security``" command to display the |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
1380 current Role and Permission configuration in your tracker. |
| 935 | 1381 |
|
1003
f89b8d32291b
Hack hack hack...
Richard Jones <richard@users.sourceforge.net>
parents:
935
diff
changeset
|
1382 Adding a new Permission |
| 1098 | 1383 ----------------------- |
|
1003
f89b8d32291b
Hack hack hack...
Richard Jones <richard@users.sourceforge.net>
parents:
935
diff
changeset
|
1384 |
|
f89b8d32291b
Hack hack hack...
Richard Jones <richard@users.sourceforge.net>
parents:
935
diff
changeset
|
1385 When adding a new Permission, you will need to: |
|
f89b8d32291b
Hack hack hack...
Richard Jones <richard@users.sourceforge.net>
parents:
935
diff
changeset
|
1386 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
1387 1. add it to your tracker's dbinit so it is created |
|
1003
f89b8d32291b
Hack hack hack...
Richard Jones <richard@users.sourceforge.net>
parents:
935
diff
changeset
|
1388 2. enable it for the Roles that should have it (verify with |
|
f89b8d32291b
Hack hack hack...
Richard Jones <richard@users.sourceforge.net>
parents:
935
diff
changeset
|
1389 "``roundup-admin security``") |
|
f89b8d32291b
Hack hack hack...
Richard Jones <richard@users.sourceforge.net>
parents:
935
diff
changeset
|
1390 3. add it to the relevant HTML interface templates |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
1391 4. add it to the appropriate xxxPermission methods on in your tracker |
|
1003
f89b8d32291b
Hack hack hack...
Richard Jones <richard@users.sourceforge.net>
parents:
935
diff
changeset
|
1392 interfaces module |
|
f89b8d32291b
Hack hack hack...
Richard Jones <richard@users.sourceforge.net>
parents:
935
diff
changeset
|
1393 |
|
f89b8d32291b
Hack hack hack...
Richard Jones <richard@users.sourceforge.net>
parents:
935
diff
changeset
|
1394 |
|
910
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1395 |
| 1100 | 1396 Examples |
| 1397 ======== | |
| 1398 | |
| 1399 Adding a new field to a roundup schema | |
| 1400 -------------------------------------- | |
| 1401 | |
| 1402 This example shows how to add a new constrained property (ie. a selection of | |
| 1403 distinct values) to your tracker. | |
| 1098 | 1404 |
| 1405 Introduction | |
| 1100 | 1406 ~~~~~~~~~~~~ |
| 1098 | 1407 |
| 1408 To make the classic schema of roundup useful as a todo tracking system | |
| 1409 for a group of systems administrators, it needed an extra data field | |
| 1410 per issue: a category. | |
| 1411 | |
| 1412 This would let sysads quickly list all todos in their particular | |
| 1413 area of interest without having to do complex queries, and without | |
| 1414 relying on the spelling capabilities of other sysads (a losing | |
| 1415 proposition at best). | |
| 1416 | |
| 1417 Adding a field to the database | |
| 1100 | 1418 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1098 | 1419 |
| 1420 This is the easiest part of the change. The category would just be a plain | |
| 1421 string, nothing fancy. To change what is in the database you need to add | |
| 1422 some lines to the ``open()`` function in ``dbinit.py``:: | |
| 1423 | |
| 1424 category = Class(db, "category", name=String()) | |
| 1425 category.setkey("name") | |
| 1426 | |
| 1427 Here we are setting up a chunk of the database which we are calling | |
| 1428 "category". It contains a string, which we are refering to as "name" for | |
| 1429 lack of a more imaginative title. Then we are setting the key of this chunk | |
| 1430 of the database to be that "name". This is equivalent to an index for | |
| 1431 database types. This also means that there can only be one category with a | |
| 1432 given name. | |
| 1433 | |
| 1434 Adding the above lines allows us to create categories, but they're not tied | |
| 1435 to the issues that we are going to be creating. It's just a list of categories | |
| 1436 off on its own, which isn't much use. We need to link it in with the issues. | |
| 1437 To do that, find the lines in the ``open()`` function in ``dbinit.py`` which | |
| 1438 set up the "issue" class, and then add a link to the category:: | |
| 1439 | |
| 1440 issue = IssueClass(db, "issue", ... , category=Multilink("category"), ... ) | |
| 1441 | |
| 1442 The Multilink() means that each issue can have many categories. If you were | |
| 1443 adding something with a more one to one relationship use Link() instead. | |
| 1444 | |
| 1445 That is all you need to do to change the schema. The rest of the effort is | |
| 1446 fiddling around so you can actually use the new category. | |
| 1447 | |
| 1448 Setting up security on the new objects | |
| 1100 | 1449 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1098 | 1450 |
| 1451 By default only the admin user can look at and change objects. This doesn't | |
| 1452 suit us, as we want any user to be able to create new categories as | |
| 1453 required, and obviously everyone needs to be able to view the categories of | |
| 1454 issues for it to be useful. | |
| 1455 | |
| 1456 We therefore need to change the security of the category objects. This is | |
| 1457 also done in the ``open()`` function of ``dbinit.py``. | |
| 1458 | |
| 1459 There are currently two loops which set up permissions and then assign them | |
| 1460 to various roles. Simply add the new "category" to both lists:: | |
| 1461 | |
| 1462 # new permissions for this schema | |
| 1463 for cl in 'issue', 'file', 'msg', 'user', 'category': | |
| 1464 db.security.addPermission(name="Edit", klass=cl, | |
| 1465 description="User is allowed to edit "+cl) | |
| 1466 db.security.addPermission(name="View", klass=cl, | |
| 1467 description="User is allowed to access "+cl) | |
| 1468 | |
| 1469 # Assign the access and edit permissions for issue, file and message | |
| 1470 # to regular users now | |
| 1471 for cl in 'issue', 'file', 'msg', 'category': | |
| 1472 p = db.security.getPermission('View', cl) | |
| 1473 db.security.addPermissionToRole('User', p) | |
| 1474 p = db.security.getPermission('Edit', cl) | |
| 1475 db.security.addPermissionToRole('User', p) | |
| 1476 | |
| 1477 So you are in effect doing the following:: | |
| 1478 | |
| 1479 db.security.addPermission(name="Edit", klass='category', | |
| 1480 description="User is allowed to edit "+'category') | |
| 1481 db.security.addPermission(name="View", klass='category', | |
| 1482 description="User is allowed to access "+'category') | |
| 1483 | |
| 1484 which is creating two permission types; that of editing and viewing | |
| 1485 "category" objects respectively. Then the following lines assign those new | |
| 1486 permissions to the "User" role, so that normal users can view and edit | |
| 1487 "category" objects:: | |
| 1488 | |
| 1489 p = db.security.getPermission('View', 'category') | |
| 1490 db.security.addPermissionToRole('User', p) | |
| 1491 | |
| 1492 p = db.security.getPermission('Edit', 'category') | |
| 1493 db.security.addPermissionToRole('User', p) | |
| 1494 | |
| 1495 This is all the work that needs to be done for the database. It will store | |
| 1496 categories, and let users view and edit them. Now on to the interface | |
| 1497 stuff. | |
| 1498 | |
| 1499 Changing the web left hand frame | |
| 1100 | 1500 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1098 | 1501 |
| 1502 We need to give the users the ability to create new categories, and the | |
| 1503 place to put the link to this functionality is in the left hand function | |
| 1504 bar, under the "Issues" area. The file that defines how this area looks is | |
| 1505 ``html/page``, which is what we are going to be editing next. | |
| 1506 | |
| 1507 If you look at this file you can see that it contains a lot of "classblock" | |
| 1508 sections which are chunks of HTML that will be included or excluded in the | |
| 1509 output depending on whether the condition in the classblock is met. Under | |
| 1510 the end of the classblock for issue is where we are going to add the | |
| 1511 category code:: | |
| 1512 | |
| 1513 <p class="classblock" | |
| 1514 tal:condition="python:request.user.hasPermission('View', 'category')"> | |
| 1515 <b>Categories</b><br> | |
| 1516 <a tal:condition="python:request.user.hasPermission('Edit', 'category')" | |
| 1517 href="category?:template=item">New Category<br></a> | |
| 1518 </p> | |
| 1519 | |
| 1520 The first two lines is the classblock definition, which sets up a condition | |
| 1521 that only users who have "View" permission to the "category" object will | |
| 1522 have this section included in their output. Next comes a plain "Categories" | |
| 1523 header in bold. Everyone who can view categories will get that. | |
| 1524 | |
| 1525 Next comes the link to the editing area of categories. This link will only | |
| 1526 appear if the condition is matched: that condition being that the user has | |
| 1527 "Edit" permissions for the "category" objects. If they do have permission | |
| 1528 then they will get a link to another page which will let the user add new | |
| 1529 categories. | |
| 1530 | |
| 1531 Note that if you have permission to view but not edit categories then all | |
| 1532 you will see is a "Categories" header with nothing underneath it. This is | |
| 1533 obviously not very good interface design, but will do for now. I just claim | |
| 1534 that it is so I can add more links in this section later on. However to fix | |
| 1535 the problem you could change the condition in the classblock statement, so | |
| 1536 that only users with "Edit" permission would see the "Categories" stuff. | |
| 1537 | |
| 1538 Setting up a page to edit categories | |
| 1100 | 1539 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1098 | 1540 |
| 1541 We defined code in the previous section which let users with the | |
| 1542 appropriate permissions see a link to a page which would let them edit | |
| 1543 conditions. Now we have to write that page. | |
| 1544 | |
| 1545 The link was for the item template for the category object. This translates | |
| 1546 into the system looking for a file called ``category.item`` in the ``html`` | |
| 1547 tracker directory. This is the file that we are going to write now. | |
| 1548 | |
| 1549 First we add an id tag in a comment which doesn't affect the outcome | |
| 1550 of the code at all but is essential for managing the changes to this | |
| 1551 file. It is useful for debugging however, if you load a page in a | |
| 1552 browser and look at the page source, you can see which sections come | |
| 1553 from which files by looking for these comments:: | |
| 1554 | |
| 1555 <!-- dollarId: category.item,v 1.3 2002/05/22 00:32:34 me Exp dollar--> | |
| 1556 | |
| 1557 Next we need to setup up a standard HTML form, which is the whole | |
| 1558 purpose of this file. We link to some handy javascript which sends the form | |
| 1559 through only once. This is to stop users hitting the send button | |
| 1560 multiple times when they are impatient and thus having the form sent | |
| 1561 multiple times:: | |
| 1562 | |
| 1563 <form method="POST" onSubmit="return submit_once()" | |
| 1564 enctype="multipart/form-data"> | |
| 1565 | |
| 1566 Next we define some code which sets up the minimum list of fields that we | |
| 1567 require the user to enter. There will be only one field, that of "name", so | |
| 1568 they user better put something in it otherwise the whole form is pointless:: | |
| 1569 | |
| 1570 <input type="hidden" name=":required" value="name"> | |
| 1571 | |
| 1572 To get everything to line up properly we will put everything in a table, | |
| 1573 and put a nice big header on it so the user has an idea what is happening:: | |
| 1574 | |
| 1575 <table class="form"> | |
|
1113
a95428868bf4
Added the missing keyword/topic interface to classic template (blush)
Richard Jones <richard@users.sourceforge.net>
parents:
1100
diff
changeset
|
1576 <tr><th class="header" colspan=2>Category</th></tr> |
| 1098 | 1577 |
| 1578 Next we need the actual field that the user is going to enter the new | |
| 1579 category. The "context.name.field(size=60)" bit tells roundup to generate a | |
| 1580 normal HTML field of size 60, and the contents of that field will be the | |
| 1581 "name" variable of the current context (which is "category"). The upshot of | |
| 1582 this is that when the user types something in to the form, a new category | |
| 1583 will be created with that name:: | |
| 1584 | |
| 1585 <tr> | |
|
1113
a95428868bf4
Added the missing keyword/topic interface to classic template (blush)
Richard Jones <richard@users.sourceforge.net>
parents:
1100
diff
changeset
|
1586 <th nowrap>Name</th> |
| 1098 | 1587 <td tal:content="structure python:context.name.field(size=60)">name</td> |
| 1588 </tr> | |
| 1589 | |
| 1590 Finally a submit button so that the user can submit the new category:: | |
| 1591 | |
| 1592 <tr> | |
| 1593 <td> </td> | |
| 1594 <td colspan=3 tal:content="structure context/submit"> | |
| 1595 submit button will go here | |
| 1596 </td> | |
| 1597 </tr> | |
| 1598 | |
| 1599 So putting it all together, and closing the table and form we get:: | |
| 1600 | |
| 1601 <!-- dollarId: category.item,v 1.3 2002/05/22 00:32:34 richard Exp dollar--> | |
| 1602 | |
| 1603 <form method="POST" onSubmit="return submit_once()" | |
| 1604 enctype="multipart/form-data"> | |
| 1605 | |
| 1606 <input type="hidden" name=":required" value="name"> | |
| 1607 | |
| 1608 <table class="form"> | |
|
1113
a95428868bf4
Added the missing keyword/topic interface to classic template (blush)
Richard Jones <richard@users.sourceforge.net>
parents:
1100
diff
changeset
|
1609 <tr><th class="header" colspan=2>Category</th></tr> |
| 1098 | 1610 |
| 1611 <tr> | |
|
1113
a95428868bf4
Added the missing keyword/topic interface to classic template (blush)
Richard Jones <richard@users.sourceforge.net>
parents:
1100
diff
changeset
|
1612 <th nowrap>Name</th> |
| 1098 | 1613 <td tal:content="structure python:context.name.field(size=60)">name</td> |
| 1614 </tr> | |
| 1615 | |
| 1616 <tr> | |
| 1617 <td> </td> | |
| 1618 <td colspan=3 tal:content="structure context/submit"> | |
| 1619 submit button will go here | |
| 1620 </td> | |
| 1621 </tr> | |
| 1622 </table> | |
| 1623 </form> | |
| 1624 | |
| 1625 This is quite a lot to just ask the user one simple question, but | |
| 1626 there is a lot of setup for basically one line (the form line) to do | |
| 1627 its work. To add another field to "category" would involve one more line | |
| 1628 (well maybe a few extra to get the formatting correct). | |
| 1629 | |
| 1630 Adding the category to the issue | |
| 1100 | 1631 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1098 | 1632 |
| 1633 We now have the ability to create issues to our hearts content, but | |
| 1634 that is pointless unless we can assign categories to issues. Just like | |
| 1635 the ``html/category.item`` file was used to define how to add a new | |
| 1636 category, the ``html/issue.item`` is used to define how a new issue is | |
| 1637 created. | |
| 1638 | |
| 1639 Just like ``category.issue`` this file defines a form which has a table to lay | |
| 1640 things out. It doesn't matter where in the table we add new stuff, | |
| 1641 it is entirely up to your sense of aesthetics:: | |
| 1642 | |
| 1643 <th nowrap>Category</th> | |
| 1644 <td><span tal:replace="structure context/category/field" /> | |
|
1113
a95428868bf4
Added the missing keyword/topic interface to classic template (blush)
Richard Jones <richard@users.sourceforge.net>
parents:
1100
diff
changeset
|
1645 <span tal:replace="structure db/category/classhelp" /> |
| 1098 | 1646 </td> |
| 1647 | |
| 1648 First we define a nice header so that the user knows what the next section | |
| 1649 is, then the middle line does what we are most interested in. This | |
| 1650 ``context/category/field`` gets replaced with a field which contains the | |
| 1651 category in the current context (the current context being the new issue). | |
| 1652 | |
| 1653 The classhelp lines generate a link (labelled "list") to a popup window | |
| 1654 which contains the list of currently known categories. | |
| 1655 | |
| 1656 Searching on categories | |
| 1100 | 1657 ~~~~~~~~~~~~~~~~~~~~~~~ |
| 1098 | 1658 |
| 1659 We can add categories, and create issues with categories. The next obvious | |
| 1660 thing that we would like to be would be to search issues based on their | |
| 1661 category, so that any one working on the web server could look at all | |
| 1662 issues in the category "Web" for example. | |
| 1663 | |
| 1664 If you look in the html/page file and look for the "Search Issues" you will | |
| 1665 see that it looks something like ``<a href="issue?:template=search">Search | |
| 1666 Issues</a>`` which shows us that when you click on "Search Issues" it will | |
| 1667 be looking for a ``issue.search`` file to display. So that is indeed the file | |
| 1668 that we are going to change. | |
| 1669 | |
| 1670 If you look at this file it should be starting to seem familiar. It is a | |
| 1671 simple HTML form using a table to define structure. You can add the new | |
| 1672 category search code anywhere you like within that form:: | |
| 1673 | |
| 1674 <tr> | |
| 1675 <th>Category:</th> | |
| 1676 <td> | |
| 1677 <select name="category"> | |
| 1678 <option value="">don't care</option> | |
| 1679 <option value="">------------</option> | |
| 1680 <option tal:repeat="s db/category/list" tal:attributes="value s/name" | |
| 1681 tal:content="s/name">category to filter on</option> | |
| 1682 </select> | |
| 1683 </td> | |
| 1684 <td><input type="checkbox" name=":columns" value="category" checked></td> | |
| 1685 <td><input type="radio" name=":sort" value="category"></td> | |
| 1686 <td><input type="radio" name=":group" value="category"></td> | |
| 1687 </tr> | |
| 1688 | |
| 1689 Most of this is straightforward to anyone who knows HTML. It is just | |
| 1690 setting up a select list followed by a checkbox and a couple of radio | |
| 1691 buttons. | |
| 1692 | |
| 1693 The ``tal:repeat`` part repeats the tag for every item in the "category" | |
| 1694 table and setting "s" to be each category in turn. | |
| 1695 | |
| 1696 The ``tal:attributes`` part is setting up the ``value=`` part of the option tag | |
| 1697 to be the name part of "s" which is the current category in the loop. | |
| 1698 | |
| 1699 The ``tal:content`` part is setting the contents of the option tag to be the | |
| 1700 name part of "s" again. For objects more complex than category, obviously | |
| 1701 you would put an id in the value, and the descriptive part in the content; | |
| 1702 but for category they are the same. | |
| 1703 | |
| 1704 Adding category to the default view | |
| 1100 | 1705 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1098 | 1706 |
| 1707 We can now add categories, add issues with categories, and search issues | |
| 1708 based on categories. This is everything that we need to do, however there | |
| 1709 is some more icing that we would like. I think the category of an issue is | |
| 1710 important enough that it should be displayed by default when listing all | |
| 1711 the issues. | |
| 1712 | |
| 1713 Unfortunately, this is a bit less obvious than the previous steps. The code | |
| 1714 defining how the issues look is in ``html/issue.index``. This is a large table | |
| 1715 with a form down the bottom for redisplaying and so forth. | |
| 1716 | |
| 1717 Firstly we need to add an appropriate header to the start of the table:: | |
| 1718 | |
| 1719 <th tal:condition="request/show/category">Category</th> | |
| 1720 | |
| 1721 The condition part of this statement is so that if the user has selected | |
| 1722 not to see the Category column then they won't. | |
| 1723 | |
| 1724 The rest of the table is a loop which will go through every issue that | |
| 1725 matches the display criteria. The loop variable is "i" - which means that | |
| 1726 every issue gets assigned to "i" in turn. | |
| 1727 | |
| 1728 The new part of code to display the category will look like this:: | |
| 1729 | |
| 1730 <td tal:condition="request/show/category" tal:content="i/category"></td> | |
| 1731 | |
| 1732 The condition is the same as above: only display the condition when the | |
| 1733 user hasn't asked for it to be hidden. The next part is to set the content | |
| 1734 of the cell to be the category part of "i" - the current issue. | |
| 1735 | |
| 1736 Finally we have to edit ``html/page`` again. This time to tell it that when the | |
| 1737 user clicks on "Unnasigned Issues" or "All Issues" that the category should | |
| 1738 be displayed. If you scroll down the page file, you can see the links with | |
| 1739 lots of options. The option that we are interested in is the ``:columns=`` one | |
| 1740 which tells roundup which fields of the issue to display. Simply add | |
| 1741 "category" to that list and it all should work. | |
| 1742 | |
| 1743 | |
| 1100 | 1744 Adding in state transition control |
| 1745 ---------------------------------- | |
| 1746 | |
| 1747 Sometimes tracker admins want to control the states that users may move issues | |
| 1748 to. | |
| 1749 | |
| 1750 1. add a Multilink property to the status class:: | |
| 1751 | |
| 1752 stat = Class(db, "status", ... , transitions=Multilink('status'), ...) | |
| 1753 | |
| 1754 and then edit the statuses already created through the web using the | |
| 1755 generic class list / CSV editor. | |
| 1756 | |
| 1757 2. add an auditor module ``checktransition.py`` in your tracker's | |
| 1758 ``detectors`` directory:: | |
| 1759 | |
| 1760 def checktransition(db, cl, nodeid, newvalues): | |
| 1761 ''' Check that the desired transition is valid for the "status" | |
| 1762 property. | |
| 1763 ''' | |
| 1764 if not newvalues.has_key('status'): | |
| 1765 return | |
| 1766 current = cl.get(nodeid, 'status') | |
| 1767 new = newvalues['status'] | |
| 1768 if new == current: | |
| 1769 return | |
| 1770 ok = db.status.get(current, 'transitions') | |
| 1771 if new not in ok: | |
| 1772 raise ValueError, 'Status not allowed to move from "%s" to "%s"'%( | |
| 1773 db.status.get(current, 'name'), db.status.get(new, 'name')) | |
| 1774 | |
| 1775 def init(db): | |
| 1776 db.issue.audit('set', checktransition) | |
| 1777 | |
| 1778 3. in the ``issue.item`` template, change the status editing bit from:: | |
| 1779 | |
| 1780 <th nowrap>Status</th> | |
| 1781 <td tal:content="structure context/status/menu">status</td> | |
| 1782 | |
| 1783 to:: | |
| 1784 | |
| 1785 <th nowrap>Status</th> | |
| 1786 <td> | |
| 1787 <select tal:condition="context/id" name="status"> | |
| 1788 <tal:block tal:define="ok context/status/transitions" | |
| 1789 tal:repeat="state db/status/list"> | |
| 1790 <option tal:condition="python:state.id in ok" | |
| 1791 tal:attributes="value state/id; | |
| 1792 selected python:state.id == context.status.id" | |
| 1793 tal:content="state/name"></option> | |
| 1794 </tal:block> | |
| 1795 </select> | |
| 1796 <tal:block tal:condition="not:context/id" | |
| 1797 tal:replace="structure context/status/menu" /> | |
| 1798 </td> | |
| 1799 | |
| 1800 which displays only the allowed status to transition to. | |
| 1801 | |
| 1802 | |
|
1133
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
1803 Displaying entire message contents in the issue display |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
1804 ------------------------------------------------------- |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
1805 |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
1806 Alter the issue.item template section for messages to:: |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
1807 |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
1808 <table class="messages" tal:condition="context/messages"> |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
1809 <tr><th colspan=3 class="header">Messages</th></tr> |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
1810 <tal:block tal:repeat="msg context/messages/reverse"> |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
1811 <tr> |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
1812 <th><a tal:attributes="href string:msg${msg/id}" |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
1813 tal:content="string:msg${msg/id}"></a></th> |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
1814 <th tal:content="string:Author: ${msg/author}">author</th> |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
1815 <th tal:content="string:Date: ${msg/date}">date</th> |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
1816 </tr> |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
1817 <tr> |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
1818 <td colspan="3" class="content"> |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
1819 <pre tal:content="msg/content">content</pre> |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
1820 </td> |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
1821 </tr> |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
1822 </tal:block> |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
1823 </table> |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
1824 |
|
1147
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1825 Restricting the list of users that are assignable to a task |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1826 ----------------------------------------------------------- |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1827 |
| 1150 | 1828 1. In your tracker's "dbinit.py", create a new Role, say "Developer":: |
|
1147
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1829 |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1830 db.security.addRole(name='Developer', description='A developer') |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1831 |
| 1150 | 1832 2. Just after that, create a new Permission, say "Fixer", specific to "issue":: |
|
1147
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1833 |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1834 p = db.security.addPermission(name='Fixer', klass='issue', |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1835 description='User is allowed to be assigned to fix issues') |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1836 |
| 1150 | 1837 3. Then assign the new Permission to your "Developer" Role:: |
|
1147
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1838 |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1839 db.security.addPermissionToRole('Developer', p) |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1840 |
| 1150 | 1841 4. In the issue item edit page ("html/issue.item" in your tracker dir), use |
| 1842 the new Permission in restricting the "assignedto" list:: | |
|
1147
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1843 |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1844 <select name="assignedto"> |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1845 <option value="-1">- no selection -</option> |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1846 <tal:block tal:repeat="user db/user/list"> |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1847 <option tal:condition="python:user.hasPermission('Fixer', context.classname)" |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1848 tal:attributes="value user/id; |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1849 selected python:user.id == context.assignedto" |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1850 tal:content="user/realname"></option> |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1851 </tal:block> |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1852 </select> |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1853 |
| 1149 | 1854 For extra security, you may wish to set up an auditor to enforce the |
| 1150 | 1855 Permission requirement (install this as "assignedtoFixer.py" in your tracker |
| 1856 "detectors" directory):: | |
|
1147
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1857 |
| 1149 | 1858 def assignedtoMustBeFixer(db, cl, nodeid, newvalues): |
| 1859 ''' Ensure the assignedto value in newvalues is a used with the Fixer | |
| 1860 Permission | |
| 1861 ''' | |
| 1862 if not newvalues.has_key('assignedto'): | |
| 1863 # don't care | |
| 1864 return | |
| 1865 | |
| 1866 # get the userid | |
| 1867 userid = newvalues['assignedto'] | |
| 1868 if not db.security.hasPermission('Fixer', userid, cl.classname): | |
| 1869 raise ValueError, 'You do not have permission to edit %s'%cl.classname | |
| 1870 | |
| 1871 def init(db): | |
| 1872 db.issue.audit('set', assignedtoMustBeFixer) | |
| 1873 db.issue.audit('create', assignedtoMustBeFixer) | |
| 1874 | |
| 1875 So now, if the edit attempts to set the assignedto to a user that doesn't have | |
| 1876 the "Fixer" Permission, the error will be raised. | |
|
1147
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1877 |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
1878 |
|
1151
7e0024954954
making it easier to add new actions, and more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1150
diff
changeset
|
1879 Setting up a "wizard" (or "druid") for controlled adding of issues |
|
7e0024954954
making it easier to add new actions, and more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1150
diff
changeset
|
1880 ------------------------------------------------------------------ |
|
7e0024954954
making it easier to add new actions, and more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1150
diff
changeset
|
1881 |
|
1154
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1882 1. Set up the page templates you wish to use for data input. My wizard |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1883 is going to be a two-step process, first figuring out what category of |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1884 issue the user is submitting, and then getting details specific to that |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1885 category. The first page includes a table of help, explaining what the |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1886 category names mean, and then the core of the form:: |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1887 |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1888 <form method="POST" onSubmit="return submit_once()" |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1889 enctype="multipart/form-data"> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1890 <input type="hidden" name=":template" value="add_page1"> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1891 <input type="hidden" name=":action" value="page1submit"> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1892 |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1893 <strong>Category:</strong> |
|
1156
d0da32fbdedc
gadfly backend now complete
Richard Jones <richard@users.sourceforge.net>
parents:
1154
diff
changeset
|
1894 <tal:block tal:replace="structure context/category/menu" /> |
|
1154
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1895 <input type="submit" value="Continue"> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1896 </form> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1897 |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1898 The next page has the usual issue entry information, with the addition of |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1899 the following form fragments:: |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1900 |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1901 |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1902 <form method="POST" onSubmit="return submit_once()" |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1903 enctype="multipart/form-data" tal:condition="context/is_edit_ok" |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1904 tal:define="cat request/form/category/value"> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1905 |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1906 <input type="hidden" name=":template" value="add_page2"> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1907 <input type="hidden" name=":required" value="title"> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1908 <input type="hidden" name="category" tal:attributes="value cat"> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1909 |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1910 . |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1911 . |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1912 . |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1913 </form> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1914 |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1915 Note that later in the form, I test the value of "cat" include form |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1916 elements that are appropriate. For example:: |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1917 |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1918 <tal:block tal:condition="python:cat in '6 10 13 14 15 16 17'.split()"> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1919 <tr> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1920 <th nowrap>Operating System</th> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1921 <td tal:content="structure context/os/field"></td> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1922 </tr> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1923 <tr> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1924 <th nowrap>Web Browser</th> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1925 <td tal:content="structure context/browser/field"></td> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1926 </tr> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1927 </tal:block> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1928 |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1929 ... the above section will only be displayed if the category is one of 6, |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1930 10, 13, 14, 15, 16 or 17. |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1931 |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1932 3. Determine what actions need to be taken between the pages - these are |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1933 usually to validate user choices and determine what page is next. Now |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1934 encode those actions in methods on the interfaces Client class and insert |
|
1151
7e0024954954
making it easier to add new actions, and more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1150
diff
changeset
|
1935 hooks to those actions in the "actions" attribute on that class, like so:: |
|
7e0024954954
making it easier to add new actions, and more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1150
diff
changeset
|
1936 |
|
7e0024954954
making it easier to add new actions, and more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1150
diff
changeset
|
1937 actions = client.Class.actions + ( |
|
7e0024954954
making it easier to add new actions, and more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1150
diff
changeset
|
1938 ('page1_submit', page1SubmitAction), |
|
7e0024954954
making it easier to add new actions, and more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1150
diff
changeset
|
1939 ) |
|
7e0024954954
making it easier to add new actions, and more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1150
diff
changeset
|
1940 |
|
7e0024954954
making it easier to add new actions, and more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1150
diff
changeset
|
1941 def page1SubmitAction(self): |
|
1154
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1942 ''' Verify that the user has selected a category, and then move on |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1943 to page 2. |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1944 ''' |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1945 category = self.form['category'].value |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1946 if category == '-1': |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1947 self.error_message.append('You must select a category of report') |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1948 return |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1949 # everything's ok, move on to the next page |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1950 self.template = 'add_page2' |
|
1151
7e0024954954
making it easier to add new actions, and more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1150
diff
changeset
|
1951 |
| 1164 | 1952 4. Use the usual "new" action as the :action on the final page, and you're |
|
1154
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
1953 done (the standard context/submit method can do this for you). |
|
1151
7e0024954954
making it easier to add new actions, and more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1150
diff
changeset
|
1954 |
| 1098 | 1955 ------------------- |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1956 |
|
686
c52122f38c9b
Documentation cleanup, added info for potential (and current) developers
Richard Jones <richard@users.sourceforge.net>
parents:
684
diff
changeset
|
1957 Back to `Table of Contents`_ |
|
c52122f38c9b
Documentation cleanup, added info for potential (and current) developers
Richard Jones <richard@users.sourceforge.net>
parents:
684
diff
changeset
|
1958 |
|
c52122f38c9b
Documentation cleanup, added info for potential (and current) developers
Richard Jones <richard@users.sourceforge.net>
parents:
684
diff
changeset
|
1959 .. _`Table of Contents`: index.html |
|
c52122f38c9b
Documentation cleanup, added info for potential (and current) developers
Richard Jones <richard@users.sourceforge.net>
parents:
684
diff
changeset
|
1960 |
