Mercurial > p > roundup > code
annotate doc/customizing.txt @ 1457:fd806ad85621
fix doc bug
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 20 Feb 2003 07:13:40 +0000 |
| parents | bbb1e5f8fc93 |
| children | 94ec56691f07 |
| rev | line source |
|---|---|
|
1215
f83efa574177
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1214
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 |
| 1457 | 5 :Version: $Revision: 1.76 $ |
|
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 |
|
1244
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
16 Before you get too far, it's probably worth having a quick read of the Roundup |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
17 `design documentation`_. |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
18 |
| 935 | 19 Customisation of Roundup can take one of five forms: |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
20 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
21 1. `tracker configuration`_ file changes |
|
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
22 2. database, or `tracker schema`_ changes |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
23 3. "definition" class `database content`_ changes |
|
909
ef9c759c243e
Fix to hasPermission, thanks Stefan Seefeld.
Richard Jones <richard@users.sourceforge.net>
parents:
907
diff
changeset
|
24 4. behavioural changes, through detectors_ |
| 935 | 25 5. `access controls`_ |
|
1244
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
26 6. change the `web interface`_ |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
27 |
|
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
28 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
|
29 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
|
30 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
|
31 includes adding or removing properties from classes. |
|
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
32 |
|
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
33 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
34 Trackers in a Nutshell |
| 1098 | 35 ====================== |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
36 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
37 Trackers have the following structure: |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
38 |
| 1098 | 39 =================== ======================================================== |
| 40 Tracker File Description | |
| 41 =================== ======================================================== | |
| 42 config.py Holds the basic `tracker configuration`_ | |
| 43 dbinit.py Holds the `tracker schema`_ | |
| 44 interfaces.py Defines the Web and E-Mail interfaces for the tracker | |
| 45 select_db.py Selects the database back-end for the tracker | |
| 46 db/ Holds the tracker's database | |
| 47 db/files/ Holds the tracker's upload files and messages | |
| 48 detectors/ Auditors and reactors for this tracker | |
| 49 html/ Web interface templates, images and style sheets | |
| 50 =================== ======================================================== | |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
51 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
52 Tracker Configuration |
| 1098 | 53 ===================== |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
54 |
|
1245
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
55 The config.py located in your tracker home contains the basic configuration |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
56 for the web and e-mail components of roundup's interfaces. As the name |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
57 suggests, this file is a Python module. This means that any valid python |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
58 expression may be used in the file. Mostly though, you'll be setting the |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
59 configuration variables to string values. Python string values must be quoted |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
60 with either single or double quotes:: |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
61 |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
62 'this is a string' |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
63 "this is also a string - use it when you have a 'single quote' in the value" |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
64 this is not a string - it's not quoted |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
65 |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
66 Python strings may use formatting that's almost identical to C string |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
67 formatting. The ``%`` operator is used to perform the formatting, like so:: |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
68 |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
69 'roundup-admin@%s'%MAIL_DOMAIN |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
70 |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
71 this will create a string ``'roundup-admin@tracker.domain.example'`` if |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
72 MAIL_DOMAIN is set to ``'tracker.domain.example'``. |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
73 |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
74 You'll also note some values are set to:: |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
75 |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
76 os.path.join(TRACKER_HOME, 'db') |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
77 |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
78 or similar. This creates a new string which holds the path to the "db" |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
79 directory in the TRACKER_HOME directory. This is just a convenience so if the |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
80 TRACKER_HOME changes you don't have to edit multiple valoues. |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
81 |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
82 The configuration variables available are: |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
83 |
|
1096
fa7df238e2d4
More cleaning up of configuration, and the "instance" -> "tracker" renaming.
Richard Jones <richard@users.sourceforge.net>
parents:
1091
diff
changeset
|
84 **TRACKER_HOME** - ``os.path.split(__file__)[0]`` |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
85 The tracker home directory. The above default code will automatically |
|
1245
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
86 determine the tracker home for you, so you can just leave it alone. |
|
794
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 **MAILHOST** - ``'localhost'`` |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
89 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
|
90 |
|
1245
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
91 **MAIL_DOMAIN** - ``'tracker.domain.example'`` |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
92 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
|
93 |
|
1096
fa7df238e2d4
More cleaning up of configuration, and the "instance" -> "tracker" renaming.
Richard Jones <richard@users.sourceforge.net>
parents:
1091
diff
changeset
|
94 **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
|
95 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
|
96 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
|
97 |
|
1096
fa7df238e2d4
More cleaning up of configuration, and the "instance" -> "tracker" renaming.
Richard Jones <richard@users.sourceforge.net>
parents:
1091
diff
changeset
|
98 **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
|
99 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
|
100 in the tracker home. |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
101 |
|
1096
fa7df238e2d4
More cleaning up of configuration, and the "instance" -> "tracker" renaming.
Richard Jones <richard@users.sourceforge.net>
parents:
1091
diff
changeset
|
102 **TRACKER_NAME** - ``'Roundup issue tracker'`` |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
103 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
|
104 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
|
105 |
|
1096
fa7df238e2d4
More cleaning up of configuration, and the "instance" -> "tracker" renaming.
Richard Jones <richard@users.sourceforge.net>
parents:
1091
diff
changeset
|
106 **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
|
107 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
|
108 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
|
109 |
|
1360
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
110 **TRACKER_WEB** - ``'http://tracker.example/cgi-bin/roundup.cgi/bugs/'`` |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
111 The web address that the tracker is viewable at. This will be included in |
|
1360
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
112 information sent to users of the tracker. The URL **must** include the |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
113 cgi-bin part or anything else that is required to get to the home page of |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
114 the tracker. You **must** include a trailing '/' in the URL. |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
115 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
116 **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
|
117 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
|
118 |
|
1360
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
119 **EMAIL_FROM_TAG** - ``''`` |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
120 Additional text to include in the "name" part of the ``From:`` address used |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
121 in nosy messages. If the sending user is "Foo Bar", the ``From:`` line is |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
122 usually:: |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
123 "Foo Bar" <issue_tracker@tracker.example> |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
124 |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
125 the EMAIL_FROM_TAG goes inside the "Foo Bar" quotes like so:: |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
126 |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
127 "Foo Bar EMAIL_FROM_TAG" <issue_tracker@tracker.example> |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
128 |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
129 **MESSAGES_TO_AUTHOR** - ``'yes'`` or``'no'`` |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
130 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
|
131 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
132 **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
|
133 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
|
134 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
|
135 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
|
136 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
|
137 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
138 **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
|
139 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
|
140 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
|
141 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
|
142 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
|
143 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
144 **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
|
145 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
|
146 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
147 **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
|
148 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
|
149 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
|
150 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
151 **EMAIL_LEAVE_BODY_UNCHANGED** - ``'no'`` |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
152 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
|
153 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
|
154 either ``'yes'`` or ``'no'``. |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
155 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
156 **MAIL_DEFAULT_CLASS** - ``'issue'`` or ``''`` |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
157 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
|
158 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
|
159 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
160 The default config.py is given below - as you |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
161 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
|
162 tracker is attempted.:: |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
163 |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
164 # 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
|
165 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
|
166 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
167 # 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
|
168 MAILHOST = 'localhost' |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
169 |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
170 # 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
|
171 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
|
172 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
173 # 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
|
174 DATABASE = os.path.join(TRACKER_HOME, 'db') |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
175 |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
176 # 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
|
177 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
|
178 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
179 # 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
|
180 TRACKER_NAME = 'Roundup issue tracker' |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
181 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
182 # 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
|
183 TRACKER_EMAIL = 'issue_tracker@%s'%MAIL_DOMAIN |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
184 |
|
1360
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
185 # The web address that the tracker is viewable at. This will be included in |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
186 # information sent to users of the tracker. The URL MUST include the cgi-bin |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
187 # part or anything else that is required to get to the home page of the |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
188 # tracker. You MUST include a trailing '/' in the URL. |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
189 TRACKER_WEB = 'http://tracker.example/cgi-bin/roundup.cgi/bugs/' |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
190 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
191 # 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
|
192 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
|
193 |
|
1360
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
194 # Additional text to include in the "name" part of the From: address used |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
195 # in nosy messages. If the sending user is "Foo Bar", the From: line is |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
196 # usually: "Foo Bar" <issue_tracker@tracker.example> |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
197 # the EMAIL_FROM_TAG goes inside the "Foo Bar" quotes like so: |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
198 # "Foo Bar EMAIL_FROM_TAG" <issue_tracker@tracker.example> |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
199 EMAIL_FROM_TAG = "" |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
200 |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
201 # 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
|
202 MESSAGES_TO_AUTHOR = 'no' # either 'yes' or 'no' |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
203 |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
204 # 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
|
205 # 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
|
206 # 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
|
207 # 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
|
208 ADD_AUTHOR_TO_NOSY = 'new' # one of 'yes', 'no', 'new' |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
209 |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
210 # 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
|
211 # 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
|
212 # 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
|
213 # 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
|
214 ADD_RECIPIENTS_TO_NOSY = 'new' # either 'yes', 'no', 'new' |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
215 |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
216 # Where to place the email signature |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
217 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
|
218 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
219 # Keep email citations |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
220 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
|
221 |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
222 # Preserve the email body as is |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
223 EMAIL_LEAVE_BODY_UNCHANGED = 'no' # either 'yes' or 'no' |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
224 |
|
794
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
225 # 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
|
226 # 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
|
227 # Examples: |
|
8c6df3f14020
Added better explanation of the instance configuration.
Richard Jones <richard@users.sourceforge.net>
parents:
724
diff
changeset
|
228 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
|
229 #MAIL_DEFAULT_CLASS = '' # disable (or just comment the var out) |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
230 |
|
1360
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
231 # |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
232 # SECURITY DEFINITIONS |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
233 # |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
234 # define the Roles that a user gets when they register with the tracker |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
235 # these are a comma-separated string of role names (e.g. 'Admin,User') |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
236 NEW_WEB_USER_ROLES = 'User' |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
237 NEW_EMAIL_USER_ROLES = 'User' |
|
aa7e4e8b14be
allow additional control over the roundupdb email sending...
Richard Jones <richard@users.sourceforge.net>
parents:
1335
diff
changeset
|
238 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
239 Tracker Schema |
| 1098 | 240 ============== |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
241 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
242 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
|
243 `web interface`_ HTML template files and `detectors`_ to reflect |
|
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
244 your changes. |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
245 |
| 1091 | 246 A tracker schema defines what data is stored in the tracker's database. |
| 247 Schemas are defined using Python code in the ``dbinit.py`` module of your | |
| 248 tracker. The "classic" schema looks like this:: | |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
249 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
250 pri = Class(db, "priority", name=String(), order=String()) |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
251 pri.setkey("name") |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
252 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
253 stat = Class(db, "status", name=String(), order=String()) |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
254 stat.setkey("name") |
|
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 keyword = Class(db, "keyword", name=String()) |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
257 keyword.setkey("name") |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
258 |
|
1244
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
259 user = Class(db, "user", username=String(), organisation=String(), |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
260 password=String(), address=String(), realname=String(), phone=String()) |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
261 user.setkey("username") |
|
1244
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
262 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
263 msg = FileClass(db, "msg", author=Link("user"), summary=String(), |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
264 date=Date(), recipients=Multilink("user"), files=Multilink("file")) |
|
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 file = FileClass(db, "file", name=String(), type=String()) |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
267 |
|
1244
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
268 issue = IssueClass(db, "issue", topic=Multilink("keyword"), |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
269 status=Link("status"), assignedto=Link("user"), |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
270 priority=Link("priority")) |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
271 issue.setkey('title') |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
272 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
273 Classes and Properties - creating a new information store |
| 1098 | 274 --------------------------------------------------------- |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
275 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
276 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
|
277 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
278 priority |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
279 Defines the possible levels of urgency for issues. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
280 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
281 status |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
282 Defines the possible states of processing the issue may be in. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
283 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
284 keyword |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
285 Initially empty, will hold keywords useful for searching issues. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
286 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
287 user |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
288 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
|
289 users using roundup. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
290 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
291 msg |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
292 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
|
293 roundup. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
294 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
295 file |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
296 Initially empty, will all files attached to issues. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
297 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
298 issue |
| 1091 | 299 Initially empty, this is where the issue information is stored. |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
300 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
301 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
|
302 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
|
303 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
|
304 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
|
305 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
|
306 |
| 1091 | 307 Class and Items |
| 1098 | 308 ~~~~~~~~~~~~~~~ |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
309 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
310 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
|
311 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
|
312 about the class items. |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
313 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
|
314 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
|
315 this as the itemid. |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
316 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
317 Properties |
| 1098 | 318 ~~~~~~~~~~ |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
319 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
320 A Class is comprised of one or more properties of the following types: |
| 1091 | 321 |
| 322 * String properties are for storing arbitrary-length strings. | |
| 323 * Password properties are for storing encoded arbitrary-length strings. The | |
| 324 default encoding is defined on the roundup.password.Password class. | |
| 325 * Date properties store date-and-time stamps. Their values are Timestamp | |
| 326 objects. | |
| 327 * Number properties store numeric values. | |
| 328 * Boolean properties store on/off, yes/no, true/false values. | |
| 329 * A Link property refers to a single other item selected from a specified | |
| 330 class. The class is part of the property; the value is an integer, the id | |
| 331 of the chosen item. | |
| 332 * A Multilink property refers to possibly many items in a specified class. | |
| 333 The value is a list of integers. | |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
334 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
335 FileClass |
| 1098 | 336 ~~~~~~~~~ |
|
659
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 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
|
339 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
|
340 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
|
341 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
|
342 directory of the db directory in your tracker. |
|
659
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 IssueClass |
| 1098 | 345 ~~~~~~~~~~ |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
346 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
347 IssueClasses automatically include the "messages", "files", "nosy", and |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
348 "superseder" properties. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
349 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
|
350 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
|
351 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
|
352 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
|
353 directory) handles this action. The superceder link indicates an issue which |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
354 has superceded this one. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
355 They also have the dynamically generated "creation", "activity" and "creator" |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
356 properties. |
| 1091 | 357 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
|
358 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
|
359 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
|
360 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
|
361 that created the issue. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
362 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
363 setkey(property) |
| 1098 | 364 ~~~~~~~~~~~~~~~~ |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
365 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
366 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
|
367 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
|
368 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
|
369 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
|
370 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
|
371 of:: |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
372 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
373 roundup-admin set issue assignedto=2 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
374 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
375 or:: |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
376 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
377 roundup-admin set issue assignedto=richard |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
378 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
379 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
|
380 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
381 create(information) |
| 1098 | 382 ~~~~~~~~~~~~~~~~~~~ |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
383 |
| 1091 | 384 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
|
385 "definitional" classes like "priority" and "status". |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
386 |
|
684
5b23ff865f3a
added a "detectors" directory...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
387 |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
388 Examples of adding to your schema |
| 1098 | 389 --------------------------------- |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
390 |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
391 TODO |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
392 |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
393 |
|
684
5b23ff865f3a
added a "detectors" directory...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
394 Detectors - adding behaviour to your tracker |
| 1098 | 395 ============================================ |
|
909
ef9c759c243e
Fix to hasPermission, thanks Stefan Seefeld.
Richard Jones <richard@users.sourceforge.net>
parents:
907
diff
changeset
|
396 .. _detectors: |
|
684
5b23ff865f3a
added a "detectors" directory...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
397 |
| 1164 | 398 Detectors are initialised every time you open your tracker database, so you're |
| 399 free to add and remove them any time, even after the database is initliased | |
| 400 via the "roundup-admin initalise" command. | |
| 401 | |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
402 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
|
403 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
|
404 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
|
405 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
|
406 ones. The existing detectors installed for you are: |
|
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
407 |
|
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
408 **nosyreaction.py** |
|
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
409 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
|
410 reactor (``nosyreaction``) fires when new messages are added to issues. |
|
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
411 The nosy auditor (``updatenosy``) fires when issues are changed and figures |
|
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
412 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
|
413 **statusauditor.py** |
|
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
414 This provides the ``chatty`` auditor which changes the issue status from |
|
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
415 ``unread`` or ``closed`` to ``chatting`` if new messages appear. It also |
|
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
416 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
|
417 ``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
|
418 |
|
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
419 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
|
420 interface for detectors. |
|
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
421 |
|
909
ef9c759c243e
Fix to hasPermission, thanks Stefan Seefeld.
Richard Jones <richard@users.sourceforge.net>
parents:
907
diff
changeset
|
422 __ design.html |
|
907
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
423 |
|
684
5b23ff865f3a
added a "detectors" directory...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
424 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
|
425 ``detectors`` directory of the Roundup distribution: |
|
5b23ff865f3a
added a "detectors" directory...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
426 |
|
907
38a74d1351c5
documentation updates
Richard Jones <richard@users.sourceforge.net>
parents:
899
diff
changeset
|
427 **newissuecopy.py** |
|
684
5b23ff865f3a
added a "detectors" directory...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
428 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
|
429 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
|
430 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
|
431 |
| 1100 | 432 The detector code:: |
| 433 | |
| 434 from roundup import roundupdb | |
| 435 | |
| 436 def newissuecopy(db, cl, nodeid, oldvalues): | |
| 437 ''' Copy a message about new issues to a team address. | |
| 438 ''' | |
| 439 # so use all the messages in the create | |
| 440 change_note = cl.generateCreateNote(nodeid) | |
| 441 | |
| 442 # send a copy to the nosy list | |
| 443 for msgid in cl.get(nodeid, 'messages'): | |
| 444 try: | |
| 445 # note: last arg must be a list | |
| 446 cl.send_message(nodeid, msgid, change_note, ['team@team.host']) | |
| 447 except roundupdb.MessageSendError, message: | |
| 448 raise roundupdb.DetectorError, message | |
| 449 | |
| 450 def init(db): | |
| 451 db.issue.react('create', newissuecopy) | |
| 1091 | 452 |
|
684
5b23ff865f3a
added a "detectors" directory...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
453 |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
454 Database Content |
| 1098 | 455 ================ |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
456 |
|
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
457 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
|
458 need to edit the tracker `detectors`_ to reflect your changes. |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
459 |
|
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
460 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
|
461 resolution, ...) may be done either before or after the tracker is |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
462 initialised. The actual method of doing so is completely different in each |
|
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
463 case though, so be careful to use the right one. |
|
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
464 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
465 **Changing content before tracker initialisation** |
|
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
466 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
|
467 the create() methods. |
|
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
468 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
469 **Changing content after tracker initialisation** |
|
1317
28ae91aae74f
clarifications
Richard Jones <richard@users.sourceforge.net>
parents:
1304
diff
changeset
|
470 As the "admin" user, click on the "class list" link in the web interface |
|
28ae91aae74f
clarifications
Richard Jones <richard@users.sourceforge.net>
parents:
1304
diff
changeset
|
471 to bring up a list of all database classes. Click on the name of the class |
|
28ae91aae74f
clarifications
Richard Jones <richard@users.sourceforge.net>
parents:
1304
diff
changeset
|
472 you wish to change the content of. |
|
28ae91aae74f
clarifications
Richard Jones <richard@users.sourceforge.net>
parents:
1304
diff
changeset
|
473 |
|
28ae91aae74f
clarifications
Richard Jones <richard@users.sourceforge.net>
parents:
1304
diff
changeset
|
474 You may also use the roundup-admin interface's create, set and retire |
|
28ae91aae74f
clarifications
Richard Jones <richard@users.sourceforge.net>
parents:
1304
diff
changeset
|
475 methods to add, alter or remove items from the classes in question. |
|
1235
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
476 |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
477 See "`adding a new field to the classic schema`_" for an example that requires |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
478 database content changes. |
|
898
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
479 |
|
5ffac75a7f2e
clarification
Richard Jones <richard@users.sourceforge.net>
parents:
798
diff
changeset
|
480 |
|
1244
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
481 Access Controls |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
482 =============== |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
483 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
484 A set of Permissions are built in to the security module by default: |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
485 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
486 - Edit (everything) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
487 - View (everything) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
488 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
489 The default interfaces define: |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
490 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
491 - Web Registration |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
492 - Web Access |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
493 - Web Roles |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
494 - Email Registration |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
495 - Email Access |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
496 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
497 These are hooked into the default Roles: |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
498 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
499 - Admin (Edit everything, View everything, Web Roles) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
500 - User (Web Access, Email Access) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
501 - Anonymous (Web Registration, Email Registration) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
502 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
503 And finally, the "admin" user gets the "Admin" Role, and the "anonymous" user |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
504 gets the "Anonymous" assigned when the database is initialised on installation. |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
505 The two default schemas then define: |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
506 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
507 - Edit issue, View issue (both) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
508 - Edit file, View file (both) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
509 - Edit msg, View msg (both) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
510 - Edit support, View support (extended only) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
511 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
512 and assign those Permissions to the "User" Role. Put together, these settings |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
513 appear in the ``open()`` function of the tracker ``dbinit.py`` (the following |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
514 is taken from the "minimal" template ``dbinit.py``):: |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
515 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
516 # |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
517 # SECURITY SETTINGS |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
518 # |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
519 # new permissions for this schema |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
520 for cl in ('user', ): |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
521 db.security.addPermission(name="Edit", klass=cl, |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
522 description="User is allowed to edit "+cl) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
523 db.security.addPermission(name="View", klass=cl, |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
524 description="User is allowed to access "+cl) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
525 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
526 # and give the regular users access to the web and email interface |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
527 p = db.security.getPermission('Web Access') |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
528 db.security.addPermissionToRole('User', p) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
529 p = db.security.getPermission('Email Access') |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
530 db.security.addPermissionToRole('User', p) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
531 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
532 # May users view other user information? Comment these lines out |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
533 # if you don't want them to |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
534 p = db.security.getPermission('View', 'user') |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
535 db.security.addPermissionToRole('User', p) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
536 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
537 # Assign the appropriate permissions to the anonymous user's Anonymous |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
538 # Role. Choices here are: |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
539 # - Allow anonymous users to register through the web |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
540 p = db.security.getPermission('Web Registration') |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
541 db.security.addPermissionToRole('Anonymous', p) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
542 # - Allow anonymous (new) users to register through the email gateway |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
543 p = db.security.getPermission('Email Registration') |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
544 db.security.addPermissionToRole('Anonymous', p) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
545 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
546 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
547 New User Roles |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
548 -------------- |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
549 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
550 New users are assigned the Roles defined in the config file as: |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
551 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
552 - NEW_WEB_USER_ROLES |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
553 - NEW_EMAIL_USER_ROLES |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
554 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
555 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
556 Changing Access Controls |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
557 ------------------------ |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
558 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
559 You may alter the configuration variables to change the Role that new web or |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
560 email users get, for example to not give them access to the web interface if |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
561 they register through email. |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
562 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
563 You may use the ``roundup-admin`` "``security``" command to display the |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
564 current Role and Permission configuration in your tracker. |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
565 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
566 Adding a new Permission |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
567 ~~~~~~~~~~~~~~~~~~~~~~~ |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
568 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
569 When adding a new Permission, you will need to: |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
570 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
571 1. add it to your tracker's dbinit so it is created |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
572 2. enable it for the Roles that should have it (verify with |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
573 "``roundup-admin security``") |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
574 3. add it to the relevant HTML interface templates |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
575 4. add it to the appropriate xxxPermission methods on in your tracker |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
576 interfaces module |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
577 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
578 Example Scenarios |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
579 ~~~~~~~~~~~~~~~~~ |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
580 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
581 **automatic registration of users in the e-mail gateway** |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
582 By giving the "anonymous" user the "Email Registration" Role, any |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
583 unidentified user will automatically be registered with the tracker (with |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
584 no password, so they won't be able to log in through the web until an admin |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
585 sets them a password). Note: this is the default behaviour in the tracker |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
586 templates that ship with Roundup. |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
587 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
588 **anonymous access through the e-mail gateway** |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
589 Give the "anonymous" user the "Email Access" and ("Edit", "issue") Roles |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
590 but not giving them the "Email Registration" Role. This means that when an |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
591 unknown user sends email into the tracker, they're automatically logged in |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
592 as "anonymous". Since they don't have the "Email Registration" Role, they |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
593 won't be automatically registered, but since "anonymous" has permission |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
594 to use the gateway, they'll still be able to submit issues. Note that the |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
595 Sender information - their email address - will not be available - they're |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
596 *anonymous*. |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
597 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
598 **only developers may be assigned issues** |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
599 Create a new Permission called "Fixer" for the "issue" class. Create a new |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
600 Role "Developer" which has that Permission, and assign that to the |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
601 appropriate users. Filter the list of users available in the assignedto |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
602 list to include only those users. Enforce the Permission with an auditor. See |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
603 the example `restricting the list of users that are assignable to a task`_. |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
604 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
605 **only managers may sign off issues as complete** |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
606 Create a new Permission called "Closer" for the "issue" class. Create a new |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
607 Role "Manager" which has that Permission, and assign that to the appropriate |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
608 users. In your web interface, only display the "resolved" issue state option |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
609 when the user has the "Closer" Permissions. Enforce the Permission with |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
610 an auditor. This is very similar to the previous example, except that the |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
611 web interface check would look like:: |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
612 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
613 <option tal:condition="python:request.user.hasPermission('Closer')" |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
614 value="resolved">Resolved</option> |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
615 |
|
1252
209a47ede743
allow blank passwords again [SF#619714]
Richard Jones <richard@users.sourceforge.net>
parents:
1245
diff
changeset
|
616 **don't give users who register through email web access** |
|
209a47ede743
allow blank passwords again [SF#619714]
Richard Jones <richard@users.sourceforge.net>
parents:
1245
diff
changeset
|
617 Create a new Role called "Email User" which has all the Permissions of the |
|
209a47ede743
allow blank passwords again [SF#619714]
Richard Jones <richard@users.sourceforge.net>
parents:
1245
diff
changeset
|
618 normal "User" Role minus the "Web Access" Permission. This will allow users |
|
209a47ede743
allow blank passwords again [SF#619714]
Richard Jones <richard@users.sourceforge.net>
parents:
1245
diff
changeset
|
619 to send in emails to the tracker, but not access the web interface. |
|
1244
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
620 |
|
1317
28ae91aae74f
clarifications
Richard Jones <richard@users.sourceforge.net>
parents:
1304
diff
changeset
|
621 **let some users edit the details of all users** |
|
28ae91aae74f
clarifications
Richard Jones <richard@users.sourceforge.net>
parents:
1304
diff
changeset
|
622 Create a new Role called "User Admin" which has the Permission for editing |
|
28ae91aae74f
clarifications
Richard Jones <richard@users.sourceforge.net>
parents:
1304
diff
changeset
|
623 users:: |
|
28ae91aae74f
clarifications
Richard Jones <richard@users.sourceforge.net>
parents:
1304
diff
changeset
|
624 |
|
28ae91aae74f
clarifications
Richard Jones <richard@users.sourceforge.net>
parents:
1304
diff
changeset
|
625 db.security.addRole(name='User Admin', description='Managing users') |
|
28ae91aae74f
clarifications
Richard Jones <richard@users.sourceforge.net>
parents:
1304
diff
changeset
|
626 p = db.security.getPermission('Edit', 'user') |
|
28ae91aae74f
clarifications
Richard Jones <richard@users.sourceforge.net>
parents:
1304
diff
changeset
|
627 db.security.addPermissionToRole('User Admin', p) |
|
28ae91aae74f
clarifications
Richard Jones <richard@users.sourceforge.net>
parents:
1304
diff
changeset
|
628 |
|
28ae91aae74f
clarifications
Richard Jones <richard@users.sourceforge.net>
parents:
1304
diff
changeset
|
629 and assign the Role to the users who need the permission. |
|
28ae91aae74f
clarifications
Richard Jones <richard@users.sourceforge.net>
parents:
1304
diff
changeset
|
630 |
|
1244
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
631 |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
632 Web Interface |
| 1098 | 633 ============= |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
634 |
| 1125 | 635 .. contents:: |
| 636 :local: | |
| 637 :depth: 1 | |
| 638 | |
| 1091 | 639 The web is provided by the roundup.cgi.client module and is used by |
| 640 roundup.cgi, roundup-server and ZRoundup. | |
| 641 In all cases, we determine which tracker is being accessed | |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
642 (the first part of the URL path inside the scope of the CGI handler) and pass |
| 1091 | 643 control on to the tracker interfaces.Client class - which uses the Client class |
| 644 from roundup.cgi.client - which handles the rest of | |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
645 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
|
646 anything you want as a web interface to your tracker. |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
647 |
| 1091 | 648 Repurcussions of changing the tracker schema |
| 1098 | 649 --------------------------------------------- |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
650 |
| 1091 | 651 If you choose to change the `tracker schema`_ you will need to ensure the web |
| 652 interface knows about it: | |
| 653 | |
| 654 1. Index, item and search pages for the relevant classes may need to have | |
| 655 properties added or removed, | |
| 656 2. The "page" template may require links to be changed, as might the "home" | |
| 657 page's content arguments. | |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
658 |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
659 How requests are processed |
| 1098 | 660 -------------------------- |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
661 |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
662 The basic processing of a web request proceeds as follows: |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
663 |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
664 1. figure out who we are, defaulting to the "anonymous" user |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
665 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
|
666 3. handle any requested action (item edit, search, ...) |
|
1213
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
667 4. render the template requested by the context, resulting in HTML output |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
668 |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
669 In some situations, exceptions occur: |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
670 |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
671 - HTTP Redirect (generally raised by an action) |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
672 - SendFile (generally raised by determine_context) |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
673 here we serve up a FileClass "content" property |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
674 - SendStaticFile (generally raised by determine_context) |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
675 here we serve up a file from the tracker "html" directory |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
676 - Unauthorised (generally raised by an action) |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
677 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
|
678 message is displayed indicating that permission was not |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
679 granted for the action to take place |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
680 - NotFound (raised wherever it needs to be) |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
681 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
|
682 |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
683 Determining web context |
| 1098 | 684 ----------------------- |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
685 |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
686 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
|
687 request variable ``:template``. The URL path after the tracker identifier |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
688 is examined. Typical URL paths look like: |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
689 |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
690 1. ``/tracker/issue`` |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
691 2. ``/tracker/issue1`` |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
692 3. ``/tracker/_file/style.css`` |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
693 4. ``/cgi-bin/roundup.cgi/tracker/file1`` |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
694 5. ``/cgi-bin/roundup.cgi/tracker/file1/kitten.png`` |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
695 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
696 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
|
697 we're looking at "issue", "issue1", "_file/style.css", "file1" and |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
698 "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
|
699 entry long - longer paths are handled differently. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
700 |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
701 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
|
702 b. if the path starts with "_file" (as in example 3, |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
703 "/tracker/_file/style.css"), then the additional path entry, |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
704 "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
|
705 from the tracker "html" directory. Raises a SendStaticFile |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
706 exception. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
707 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
|
708 the tracker class we're to display. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
709 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
|
710 "file1"), then we're to display a specific item. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
711 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
|
712 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
|
713 to be handling an item of a |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
714 FileClass, and the extra path information gives the filename |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
715 that the client is going to label the download with (ie |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
716 "file1/kitten.png" is nicer to download than "file1"). This |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
717 raises a SendFile exception. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
718 |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
719 Both b. and e. stop before we bother to |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
720 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
|
721 don't actually use templates. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
722 |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
723 The template used is specified by the ``:template`` CGI variable, |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
724 which defaults to: |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
725 |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
726 - only classname suplied: "index" |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
727 - full item designator supplied: "item" |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
728 |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
729 |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
730 Performing actions in web requests |
| 1098 | 731 ---------------------------------- |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
732 |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
733 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
|
734 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
|
735 action is performed before the requested page is generated. Actions are |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
736 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
|
737 |
| 1125 | 738 **login** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
739 Attempt to log a user in. |
|
1278
0c0494deb09f
doc for the retire action
Richard Jones <richard@users.sourceforge.net>
parents:
1270
diff
changeset
|
740 |
| 1125 | 741 **logout** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
742 Log the user out - make them "anonymous". |
|
1278
0c0494deb09f
doc for the retire action
Richard Jones <richard@users.sourceforge.net>
parents:
1270
diff
changeset
|
743 |
| 1125 | 744 **register** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
745 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
|
746 them in. |
|
1278
0c0494deb09f
doc for the retire action
Richard Jones <richard@users.sourceforge.net>
parents:
1270
diff
changeset
|
747 |
| 1125 | 748 **edit** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
749 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
|
750 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
|
751 |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
752 :link=designator:property and :multilink=designator:property |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
753 The value specifies an item designator and the property on that |
| 1262 | 754 item to add *this* item to as a link or multilink. |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
755 :note |
|
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
756 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
|
757 "messages" property. |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
758 :file |
|
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
759 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
|
760 "files" property. Attach the file to the message created from |
| 1091 | 761 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
|
762 :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
|
763 The named properties are required to be filled in the form. |
|
1328
b4d4770658c1
allow multiple :remove and :add elements per property being edited
Richard Jones <richard@users.sourceforge.net>
parents:
1320
diff
changeset
|
764 :remove:<propname>=id(s) |
|
b4d4770658c1
allow multiple :remove and :add elements per property being edited
Richard Jones <richard@users.sourceforge.net>
parents:
1320
diff
changeset
|
765 The ids will be removed from the multilink property. You may have multiple |
|
b4d4770658c1
allow multiple :remove and :add elements per property being edited
Richard Jones <richard@users.sourceforge.net>
parents:
1320
diff
changeset
|
766 :remove:<propname> form elements for a single <propname>. |
|
b4d4770658c1
allow multiple :remove and :add elements per property being edited
Richard Jones <richard@users.sourceforge.net>
parents:
1320
diff
changeset
|
767 :add:<propname>=id(s) |
|
b4d4770658c1
allow multiple :remove and :add elements per property being edited
Richard Jones <richard@users.sourceforge.net>
parents:
1320
diff
changeset
|
768 The ids will be added to the multilink property. You may have multiple |
|
b4d4770658c1
allow multiple :remove and :add elements per property being edited
Richard Jones <richard@users.sourceforge.net>
parents:
1320
diff
changeset
|
769 :add:<propname> form elements for a single <propname>. |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
770 |
| 1125 | 771 **new** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
772 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
|
773 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
|
774 |
|
1278
0c0494deb09f
doc for the retire action
Richard Jones <richard@users.sourceforge.net>
parents:
1270
diff
changeset
|
775 **retire** |
|
0c0494deb09f
doc for the retire action
Richard Jones <richard@users.sourceforge.net>
parents:
1270
diff
changeset
|
776 Retire the item in the database. |
|
0c0494deb09f
doc for the retire action
Richard Jones <richard@users.sourceforge.net>
parents:
1270
diff
changeset
|
777 |
| 1125 | 778 **editCSV** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
779 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
|
780 *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
|
781 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
|
782 |
| 1125 | 783 **search** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
784 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
|
785 |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
786 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
|
787 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
|
788 "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
|
789 |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
790 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
|
791 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
|
792 |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
793 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
|
794 "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
|
795 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
|
796 interfaces.Client. So if you need to define new actions, you may add them |
| 1098 | 797 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
|
798 |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
799 Each action also has a corresponding *actionPermission* (where |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
800 "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
|
801 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
|
802 checks are: |
|
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
803 |
| 1125 | 804 **login** |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
805 Determine whether the user has permission to log in. |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
806 Base behaviour is to check the user has "Web Access". |
| 1125 | 807 **logout** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
808 No permission checks are made. |
| 1125 | 809 **register** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
810 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
|
811 Base behaviour is to check the user has "Web Registration". |
| 1125 | 812 **edit** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
813 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
|
814 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
|
815 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
|
816 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
|
817 special Permission "Web Roles". |
| 1125 | 818 **new** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
819 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
|
820 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
|
821 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
|
822 may be created if the user has the "Web Registration" Permission. |
| 1125 | 823 **editCSV** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
824 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
|
825 Base behaviour is to check the user can edit this class. |
| 1125 | 826 **search** |
|
1058
a55ef5a98fd3
more docco... and we need to check for web access Permission!
Richard Jones <richard@users.sourceforge.net>
parents:
1057
diff
changeset
|
827 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
|
828 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
|
829 |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
830 |
| 1091 | 831 Default templates |
| 1098 | 832 ----------------- |
| 1091 | 833 |
| 834 Most customisation of the web view can be done by modifying the templates in | |
| 835 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
|
836 |
| 1125 | 837 **page** |
|
1213
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
838 This template usually defines the overall look of your tracker. When you |
| 1091 | 839 view an issue, it appears inside this template. When you view an index, it |
| 1214 | 840 also appears inside this template. This template defines a macro called |
| 841 "icing" which is used by almost all other templates as a coating for their | |
| 842 content, using its "content" slot. It will also define the "head_title" | |
| 843 and "body_title" slots to allow setting of the page title. | |
| 1125 | 844 **home** |
| 1091 | 845 the default page displayed when no other page is indicated by the user |
| 1125 | 846 **home.classlist** |
| 1091 | 847 a special version of the default page that lists the classes in the tracker |
| 1125 | 848 **classname.item** |
| 1091 | 849 displays an item of the *classname* class |
| 1125 | 850 **classname.index** |
| 1091 | 851 displays a list of *classname* items |
| 1125 | 852 **classname.search** |
| 1091 | 853 displays a search page for *classname* items |
| 1125 | 854 **_generic.index** |
| 1091 | 855 used to display a list of items where there is no *classname*.index available |
| 1125 | 856 **_generic.help** |
| 1091 | 857 used to display a "class help" page where there is no *classname*.help |
| 1125 | 858 **user.register** |
| 1091 | 859 a special page just for the user class that renders the registration page |
| 1125 | 860 **style.css** |
| 1091 | 861 a static file that is served up as-is |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
862 |
| 1148 | 863 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
|
864 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
|
865 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
|
866 test template using the ":template" URL argument:: |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
867 |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
868 http://your.tracker.example/tracker/issue?:template=test |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
869 |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
870 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
|
871 |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
872 |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
873 How the templates work |
| 1098 | 874 ---------------------- |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
875 |
| 1214 | 876 Basic Templating Actions |
| 877 ~~~~~~~~~~~~~~~~~~~~~~~~ | |
| 878 | |
| 879 Roundup's templates consist of special attributes on your template tags. | |
| 880 These attributes form the Template Attribute Language, or TAL. The basic tag | |
|
1213
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
881 commands are: |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
882 |
| 1125 | 883 **tal:define="variable expression; variable expression; ..."** |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
884 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
|
885 example:: |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
886 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
887 <html tal:define="title request/description"> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
888 <head><title tal:content="title"></title></head> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
889 </html> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
890 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
891 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
|
892 expression "request/description". The tal:content command inside the <html> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
893 tag may then use the "title" variable. |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
894 |
| 1125 | 895 **tal:condition="expression"** |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
896 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
|
897 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
898 <p tal:condition="python:request.user.hasPermission('View', 'issue')"> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
899 Display some issue information. |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
900 </p> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
901 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
902 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
|
903 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
|
904 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
|
905 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
|
906 strings with anything in them (even spaces!). |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
907 |
| 1125 | 908 **tal:repeat="variable expression"** |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
909 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
|
910 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
|
911 variable for each element. For example:: |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
912 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
913 <tr tal:repeat="u user/list"> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
914 <td tal:content="u/id"></td> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
915 <td tal:content="u/username"></td> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
916 <td tal:content="u/realname"></td> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
917 </tr> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
918 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
919 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
|
920 "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
|
921 |
| 1125 | 922 **tal:replace="expression"** |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
923 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
|
924 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
925 <span tal:replace="request/user/realname"></span> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
926 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
927 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
|
928 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
|
929 would be "Bruce". |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
930 |
| 1125 | 931 **tal:content="expression"** |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
932 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
|
933 example:: |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
934 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
935 <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
|
936 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
937 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
|
938 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
|
939 would be "<span>Bruce</span>". |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
940 |
| 1125 | 941 **tal:attributes="attribute expression; attribute expression; ..."** |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
942 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
|
943 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
944 <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
|
945 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
946 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
|
947 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
|
948 like "user123". |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
949 |
| 1125 | 950 **tal:omit-tag="expression"** |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
951 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
|
952 example:: |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
953 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
954 <span tal:omit-tag="python:1">Hello, world!</span> |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
955 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
956 would result in output of:: |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
957 |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
958 Hello, world! |
|
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
959 |
| 1083 | 960 Note that the commands on a given tag are evaulated in the order above, so |
| 961 *define* comes before *condition*, and so on. | |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
962 |
| 1083 | 963 Additionally, a tag is defined, tal:block, which is removed from output. Its |
| 964 content is not, but the tag itself is (so don't go using any tal:attributes | |
| 965 commands on it). This is useful for making arbitrary blocks of HTML | |
| 966 conditional or repeatable (very handy for repeating multiple table rows, | |
| 967 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
|
968 |
| 1214 | 969 |
| 970 Templating Expressions | |
| 971 ~~~~~~~~~~~~~~~~~~~~~~ | |
| 972 | |
| 1083 | 973 The expressions you may use in the attibute values may be one of the following |
| 1214 | 974 forms: |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
975 |
| 1125 | 976 **Path Expressions** - eg. ``item/status/checklist`` |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
977 These are object attribute / item accesses. Roughly speaking, the path |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
978 ``item/status/checklist`` is broken into parts ``item``, ``status`` |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
979 and ``checklist``. The ``item`` part is the root of the expression. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
980 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
|
981 ``status`` item (as in ``item['status']``). If that |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
982 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
|
983 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
|
984 stringified. Path expressions may have an optional ``path:`` prefix, though |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
985 they are the default expression type, so it's not necessary. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
986 |
|
1244
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
987 If an expression evaluates to ``default`` then the expression is |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
988 "cancelled" - whatever HTML already exists in the template will remain |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
989 (tag content in the case of tal:content, attributes in the case of |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
990 tal:attributes). |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
991 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
992 If an expression evaluates to ``nothing`` then the target of the expression |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
993 is removed (tag content in the case of tal:content, attributes in the case |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
994 of tal:attributes and the tag itself in the case of tal:replace). |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
995 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
996 If an element in the path may not exist, then you can use the ``|`` |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
997 operator in the expression to provide an alternative. So, the expression |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
998 ``request/form/foo/value | default`` would simply leave the current HTML |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
999 in place if the "foo" form variable doesn't exist. |
|
1070
af0abadfda3a
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1058
diff
changeset
|
1000 |
|
1448
bbb1e5f8fc93
added info about structure/not:/path()
Richard Jones <richard@users.sourceforge.net>
parents:
1436
diff
changeset
|
1001 You may use the python function ``path``, as in ``path("item/status")``, to |
|
bbb1e5f8fc93
added info about structure/not:/path()
Richard Jones <richard@users.sourceforge.net>
parents:
1436
diff
changeset
|
1002 embed path expressions in Python expressions. |
|
bbb1e5f8fc93
added info about structure/not:/path()
Richard Jones <richard@users.sourceforge.net>
parents:
1436
diff
changeset
|
1003 |
| 1125 | 1004 **String Expressions** - eg. ``string:hello ${user/name}`` |
|
1365
4884fb0860f9
fixed rdbms searching by ID [SF#666615]
Richard Jones <richard@users.sourceforge.net>
parents:
1360
diff
changeset
|
1005 These expressions are simple string interpolations - though they can be just |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
1006 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
|
1007 ``${ ... }`` is just a path expression as above. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
1008 |
| 1125 | 1009 **Python Expressions** - eg. ``python: 1+1`` |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
1010 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
|
1011 variables are available, so ``python:item.status.checklist()`` would be |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
1012 equivalent to ``item/status/checklist``, assuming that ``checklist`` is |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
1013 a method. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
1014 |
|
1448
bbb1e5f8fc93
added info about structure/not:/path()
Richard Jones <richard@users.sourceforge.net>
parents:
1436
diff
changeset
|
1015 Modifiers: |
|
bbb1e5f8fc93
added info about structure/not:/path()
Richard Jones <richard@users.sourceforge.net>
parents:
1436
diff
changeset
|
1016 |
|
bbb1e5f8fc93
added info about structure/not:/path()
Richard Jones <richard@users.sourceforge.net>
parents:
1436
diff
changeset
|
1017 **structure** - eg. ``structure python:msg.content.plain(hyperlink=1)`` |
|
bbb1e5f8fc93
added info about structure/not:/path()
Richard Jones <richard@users.sourceforge.net>
parents:
1436
diff
changeset
|
1018 The result of expressions are normally *escaped* to be safe for HTML |
|
bbb1e5f8fc93
added info about structure/not:/path()
Richard Jones <richard@users.sourceforge.net>
parents:
1436
diff
changeset
|
1019 display (all "<", ">" and "&" are turned into special entities). The |
|
bbb1e5f8fc93
added info about structure/not:/path()
Richard Jones <richard@users.sourceforge.net>
parents:
1436
diff
changeset
|
1020 ``structure`` expression modifier turns off this escaping - the result |
|
bbb1e5f8fc93
added info about structure/not:/path()
Richard Jones <richard@users.sourceforge.net>
parents:
1436
diff
changeset
|
1021 of the expression is now assumed to be HTML structured text. |
|
bbb1e5f8fc93
added info about structure/not:/path()
Richard Jones <richard@users.sourceforge.net>
parents:
1436
diff
changeset
|
1022 |
|
bbb1e5f8fc93
added info about structure/not:/path()
Richard Jones <richard@users.sourceforge.net>
parents:
1436
diff
changeset
|
1023 **not:** - eg. ``not:python:1=1`` |
|
bbb1e5f8fc93
added info about structure/not:/path()
Richard Jones <richard@users.sourceforge.net>
parents:
1436
diff
changeset
|
1024 This simply inverts the logical true/false value of another expression. |
|
bbb1e5f8fc93
added info about structure/not:/path()
Richard Jones <richard@users.sourceforge.net>
parents:
1436
diff
changeset
|
1025 |
|
bbb1e5f8fc93
added info about structure/not:/path()
Richard Jones <richard@users.sourceforge.net>
parents:
1436
diff
changeset
|
1026 |
| 1214 | 1027 Template Macros |
| 1028 ~~~~~~~~~~~~~~~ | |
| 1029 | |
| 1030 Macros are used in Roundup to save us from repeating the same common page | |
| 1031 stuctures over and over. The most common (and probably only) macro you'll use | |
| 1032 is the "icing" macro defined in the "page" template. | |
| 1033 | |
| 1034 Macros are generated and used inside your templates using special attributes | |
| 1035 similar to the `basic templating actions`_. In this case though, the | |
| 1036 attributes belong to the Macro Expansion Template Attribute Language, or | |
| 1037 METAL. The macro commands are: | |
|
1213
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1038 |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1039 **metal:define-macro="macro name"** |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1040 Define that the tag and its contents are now a macro that may be inserted |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1041 into other templates using the *use-macro* command. For example:: |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1042 |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1043 <html metal:define-macro="page"> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1044 ... |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1045 </html> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1046 |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1047 defines a macro called "page" using the ``<html>`` tag and its contents. |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1048 Once defined, macros are stored on the template they're defined on in the |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1049 ``macros`` attribute. You can access them later on through the ``templates`` |
| 1214 | 1050 variable, eg. the most common ``templates/page/macros/icing`` to access the |
|
1213
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1051 "page" macro of the "page" template. |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1052 |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1053 **metal:use-macro="path expression"** |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1054 Use a macro, which is identified by the path expression (see above). This |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1055 will replace the current tag with the identified macro contents. For |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1056 example:: |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1057 |
| 1214 | 1058 <tal:block metal:use-macro="templates/page/macros/icing"> |
|
1213
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1059 ... |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1060 </tal:block> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1061 |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1062 will replace the tag and its contents with the "page" macro of the "page" |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1063 template. |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1064 |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1065 **metal:define-slot="slot name"** and **metal:fill-slot="slot name"** |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1066 To define *dynamic* parts of the macro, you define "slots" which may be |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1067 filled when the macro is used with a *use-macro* command. For example, the |
| 1214 | 1068 ``templates/page/macros/icing`` macro defines a slot like so:: |
|
1213
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1069 |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1070 <title metal:define-slot="head_title">title goes here</title> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1071 |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1072 In your *use-macro* command, you may now use a *fill-slot* command like |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1073 this:: |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1074 |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1075 <title metal:fill-slot="head_title">My Title</title> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1076 |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1077 where the tag that fills the slot completely replaces the one defined as |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1078 the slot in the macro. |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1079 |
| 1214 | 1080 Note that you may not mix METAL and TAL commands on the same tag, but TAL |
| 1081 commands may be used freely inside METAL-using tags (so your *fill-slots* | |
| 1082 tags may have all manner of TAL inside them). | |
| 1083 | |
|
1213
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1084 |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1085 Information available to templates |
| 1098 | 1086 ---------------------------------- |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1087 |
| 1125 | 1088 Note: this is implemented by roundup.cgi.templating.RoundupPageTemplate |
| 1089 | |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1090 The following variables are available to templates. |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1091 |
| 1125 | 1092 **context** |
|
1123
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1093 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
|
1094 `hyperdb class wrapper`_ or a `hyperdb item wrapper`_ |
| 1125 | 1095 **request** |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1096 Includes information about the current request, including: |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1097 - the current index information (``filterspec``, ``filter`` args, |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1098 ``properties``, etc) parsed out of the form. |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1099 - methods for easy filterspec link generation |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
1100 - *user*, the current user item as an HTMLItem instance |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1101 - *form* |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1102 The current CGI form information as a mapping of form argument |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1103 name to value |
|
1254
77920c42aeb9
Expose the tracker config as a variable for templating
Richard Jones <richard@users.sourceforge.net>
parents:
1252
diff
changeset
|
1104 **config** |
|
77920c42aeb9
Expose the tracker config as a variable for templating
Richard Jones <richard@users.sourceforge.net>
parents:
1252
diff
changeset
|
1105 This variable holds all the values defined in the tracker config.py file |
|
77920c42aeb9
Expose the tracker config as a variable for templating
Richard Jones <richard@users.sourceforge.net>
parents:
1252
diff
changeset
|
1106 (eg. TRACKER_NAME, etc.) |
| 1125 | 1107 **db** |
|
1254
77920c42aeb9
Expose the tracker config as a variable for templating
Richard Jones <richard@users.sourceforge.net>
parents:
1252
diff
changeset
|
1108 The current database, used to access arbitrary database items. |
|
1213
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1109 **templates** |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1110 Access to all the tracker templates by name. Used mainly in *use-macro* |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1111 commands. |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1112 **utils** |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1113 This variable makes available some utility functions like batching. |
| 1125 | 1114 **nothing** |
| 1100 | 1115 This is a special variable - if an expression evaluates to this, then the |
| 1116 tag (in the case of a tal:replace), its contents (in the case of | |
| 1117 tal:content) or some attributes (in the case of tal:attributes) will not | |
| 1118 appear in the the output. So for example:: | |
| 1119 | |
| 1120 <span tal:attributes="class nothing">Hello, World!</span> | |
| 1121 | |
| 1122 would result in:: | |
| 1123 | |
| 1124 <span>Hello, World!</span> | |
| 1125 | |
| 1125 | 1126 **default** |
| 1100 | 1127 Also a special variable - if an expression evaluates to this, then the |
| 1128 existing HTML in the template will not be replaced or removed, it will | |
| 1129 remain. So:: | |
| 1130 | |
| 1131 <span tal:replace="default">Hello, World!</span> | |
| 1132 | |
| 1133 would result in:: | |
| 1134 | |
| 1135 <span>Hello, World!</span> | |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1136 |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1137 The context variable |
| 1098 | 1138 ~~~~~~~~~~~~~~~~~~~~ |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1139 |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1140 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
|
1141 (see `determining web context`_ for how we figure this out): |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1142 |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1143 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
|
1144 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
|
1145 `hyperdb class wrapper`_. |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1146 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
|
1147 `hyperdb item wrapper`_. |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1148 |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1149 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
|
1150 The only real difference between cases 2 and 3 above are: |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1151 |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1152 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
|
1153 the property is displayed through ``context/property`` or |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1154 ``context/property/field``. |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1155 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
|
1156 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
|
1157 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
|
1158 |
|
1123
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1159 Hyperdb class wrapper |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1160 ::::::::::::::::::::: |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1161 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1162 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
|
1163 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1164 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
|
1165 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
|
1166 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
|
1167 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
|
1168 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1169 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
|
1170 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
|
1171 the CGI form. |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1172 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1173 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
|
1174 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1175 =========== ============================================================= |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1176 Method Description |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1177 =========== ============================================================= |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1178 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
|
1179 properties. |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1180 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
|
1181 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
|
1182 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
|
1183 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
|
1184 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
|
1185 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
|
1186 "help" template. |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1187 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
|
1188 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
|
1189 history returns 'New node - no history' :) |
|
1136
7e193bbda38e
added generic item editing
Richard Jones <richard@users.sourceforge.net>
parents:
1133
diff
changeset
|
1190 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
|
1191 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
|
1192 =========== ============================================================= |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1193 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1194 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
|
1195 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
|
1196 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1197 python:context['list'] |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1198 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1199 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
|
1200 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1201 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1202 Hyperdb item wrapper |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1203 :::::::::::::::::::: |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1204 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1205 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
|
1206 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1207 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
|
1208 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1209 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
|
1210 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
|
1211 the CGI form. |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1212 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1213 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
|
1214 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1215 =============== ============================================================= |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1216 Method Description |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1217 =============== ============================================================= |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1218 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
|
1219 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
|
1220 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
|
1221 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
|
1222 the query |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1223 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
|
1224 has a Permission |
|
1136
7e193bbda38e
added generic item editing
Richard Jones <richard@users.sourceforge.net>
parents:
1133
diff
changeset
|
1225 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
|
1226 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
|
1227 =============== ============================================================= |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1228 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1229 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1230 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
|
1231 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
|
1232 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1233 python:context['journal'] |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1234 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1235 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
|
1236 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1237 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1238 Hyperdb property wrapper |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1239 :::::::::::::::::::::::: |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1240 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1241 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
|
1242 class (HTMLStringProperty, HTMLNumberProperty, and so on). |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1243 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1244 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
|
1245 value may be either: |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1246 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1247 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
|
1248 hyperdb |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1249 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
|
1250 CGI form |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1251 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1252 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1253 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
|
1254 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1255 =============== ============================================================= |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1256 Attribute Description |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1257 =============== ============================================================= |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1258 _name the name of the property |
|
1317
28ae91aae74f
clarifications
Richard Jones <richard@users.sourceforge.net>
parents:
1304
diff
changeset
|
1259 _value the value of the property if any - this is the actual value |
|
28ae91aae74f
clarifications
Richard Jones <richard@users.sourceforge.net>
parents:
1304
diff
changeset
|
1260 retrieved from the hyperdb for this property |
|
1123
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1261 =============== ============================================================= |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1262 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1263 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
|
1264 |
|
1374
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1265 ========= ===================================================================== |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1266 Method Description |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1267 ========= ===================================================================== |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1268 plain render a "plain" representation of the property. This method may |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1269 take two arguments: |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1270 |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1271 escape |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1272 If true, escape the text so it is HTML safe (default: no). The |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1273 reason this defaults to off is that text is usually escaped |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1274 at a later stage by the TAL commands, unless the "structure" |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1275 option is used in the template. The following are all equivalent:: |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1276 |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1277 <p tal:content="structure python:msg.content.plain(escape=1)" /> |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1278 <p tal:content="python:msg.content.plain()" /> |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1279 <p tal:content="msg/content/plain" /> |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1280 <p tal:content="msg/content" /> |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1281 |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1282 Usually you'll only want to use the escape option in a complex |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1283 expression. |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1284 |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1285 hyperlink |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1286 If true, turn URLs, email addresses and hyperdb item designators |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1287 in the text into hyperlinks (default: no). Note that you'll need |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1288 to use the "structure" TAL option if you want to use this:: |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1289 |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1290 <p tal:content="structure python:msg.content.plain(hyperlink=1)" /> |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1291 |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1292 Note also that the text is automatically HTML-escape before the |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1293 hyperlinking transformation. |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1294 |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1295 field render an appropriate form edit field for the property - for most |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1296 types this is a text entry box, but for Booleans it's a tri-state |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1297 yes/no/neither selection. |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1298 stext only on String properties - render the value of the |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1299 property as StructuredText (requires the StructureText module |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1300 to be installed separately) |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1301 multiline only on String properties - render a multiline form edit |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1302 field for the property |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1303 email only on String properties - render the value of the |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1304 property as an obscured email address |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1305 confirm only on Password properties - render a second form edit field for |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1306 the property, used for confirmation that the user typed the |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1307 password correctly. Generates a field with name "name:confirm". |
|
1436
2f6647cf5345
bugger, dropping support for "+" special char
Richard Jones <richard@users.sourceforge.net>
parents:
1409
diff
changeset
|
1308 now only on Date properties - return the current date as a new property |
|
1374
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1309 reldate only on Date properties - render the interval between the |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1310 date and now |
|
1436
2f6647cf5345
bugger, dropping support for "+" special char
Richard Jones <richard@users.sourceforge.net>
parents:
1409
diff
changeset
|
1311 local only on Date properties - return this date as a new property with |
|
2f6647cf5345
bugger, dropping support for "+" special char
Richard Jones <richard@users.sourceforge.net>
parents:
1409
diff
changeset
|
1312 some timezone offset |
|
1374
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1313 pretty only on Interval properties - render the interval in a |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1314 pretty format (eg. "yesterday") |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1315 menu only on Link and Multilink properties - render a form select |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1316 list for this property |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1317 reverse only on Multilink properties - produce a list of the linked |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1318 items in reverse order |
|
8e4c3e8de96f
fix StringHTMLProperty hyperlinking
Richard Jones <richard@users.sourceforge.net>
parents:
1365
diff
changeset
|
1319 ========= ===================================================================== |
|
1123
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1320 |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1321 The request variable |
| 1098 | 1322 ~~~~~~~~~~~~~~~~~~~~ |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1323 |
|
1123
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1324 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
|
1325 |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1326 The request variable is packed with information about the current request. |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1327 |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1328 .. taken from roundup.cgi.templating.HTMLRequest docstring |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1329 |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
1330 =========== ================================================================= |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1331 Variable Holds |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
1332 =========== ================================================================= |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1333 form the CGI form as a cgi.FieldStorage |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1334 env the CGI environment variables |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
1335 base the base URL for this tracker |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1336 user a HTMLUser instance for this user |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1337 classname the current classname (possibly None) |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1338 template the current template (suffix, also possibly None) |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1339 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
|
1340 =========== ================================================================= |
| 1083 | 1341 |
| 1342 **Index page specific variables (indexing arguments)** | |
| 1343 | |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
1344 =========== ================================================================= |
| 1083 | 1345 Variable Holds |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
1346 =========== ================================================================= |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1347 columns dictionary of the columns to display in an index page |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1348 show a convenience access to columns - request/show/colname will |
| 1098 | 1349 be true if the columns should be displayed, false otherwise |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1350 sort index sort column (direction, column name) |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1351 group index grouping property (direction, column name) |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1352 filter properties to filter the index on |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1353 filterspec values to filter the index on |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1354 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
|
1355 =========== ================================================================= |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1356 |
|
1124
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1357 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
|
1358 |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
1359 =============== ============================================================= |
|
1124
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1360 Method Description |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
1361 =============== ============================================================= |
|
1124
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1362 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
|
1363 title |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1364 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
|
1365 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
|
1366 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
|
1367 the templating |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1368 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
|
1369 list of items (see `hyperdb item wrapper`_, and |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1370 `batching`_) |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
1371 =============== ============================================================= |
|
1124
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1372 |
| 1142 | 1373 The form variable |
| 1374 ::::::::::::::::: | |
| 1375 | |
| 1376 The form variable is a little special because it's actually a python | |
| 1377 FieldStorage object. That means that you have two ways to access its | |
| 1378 contents. For example, to look up the CGI form value for the variable | |
| 1379 "name", use the path expression:: | |
| 1380 | |
| 1381 request/form/name/value | |
| 1382 | |
| 1383 or the python expression:: | |
| 1384 | |
| 1385 python:request.form['name'].value | |
| 1386 | |
| 1387 Note the "item" access used in the python case, and also note the explicit | |
| 1388 "value" attribute we have to access. That's because the form variables are | |
| 1389 stored as MiniFieldStorages. If there's more than one "name" value in | |
| 1390 the form, then the above will break since ``request/form/name`` is actually a | |
| 1391 *list* of MiniFieldStorages. So it's best to know beforehand what you're | |
| 1392 dealing with. | |
| 1393 | |
| 1394 | |
|
1123
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1395 The db variable |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1396 ~~~~~~~~~~~~~~~ |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1397 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1398 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
|
1399 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1400 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
|
1401 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
|
1402 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1403 db/user |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1404 python:db.user |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1405 |
|
644d3075c2df
more documentation, fixed bug in request/description
Richard Jones <richard@users.sourceforge.net>
parents:
1113
diff
changeset
|
1406 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
|
1407 |
|
1213
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1408 The templates variable |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1409 ~~~~~~~~~~~~~~~~~~~~~~ |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1410 |
|
1213
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1411 Note: this is implemented by the roundup.cgi.templating.Templates class. |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1412 |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1413 This variable doesn't have any useful methods defined. It supports being |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1414 used in expressions to access the templates, and subsequently the template |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1415 macros. You may access the templates using the following path expression:: |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1416 |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1417 templates/name |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1418 |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1419 or the python expression:: |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1420 |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1421 templates[name] |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1422 |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1423 where "name" is the name of the template you wish to access. The template you |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1424 get access to has one useful attribute, "macros". To access a specific macro |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1425 (called "macro_name"), use the path expression:: |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1426 |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1427 templates/name/macros/macro_name |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1428 |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1429 or the python expression:: |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1430 |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1431 templates[name].macros[macro_name] |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1432 |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1433 |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1434 The utils variable |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1435 ~~~~~~~~~~~~~~~~~~ |
|
1124
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1436 |
|
1270
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
1437 Note: this is implemented by the roundup.cgi.templating.TemplatingUtils class, |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
1438 but it may be extended as described below. |
|
1124
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1439 |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
1440 =============== ============================================================= |
|
1124
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1441 Method Description |
|
1144
db13f46cb5f9
password edit now has a confirmation field
Richard Jones <richard@users.sourceforge.net>
parents:
1142
diff
changeset
|
1442 =============== ============================================================= |
|
1124
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1443 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
|
1444 =============== ============================================================= |
|
1124
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1445 |
|
1270
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
1446 You may add additional utility methods by writing them in your tracker |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
1447 ``interfaces.py`` module's ``TemplatingUtils`` class. See `adding a time log |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
1448 to your issues`_ for an example. The TemplatingUtils class itself will have a |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
1449 single attribute, ``client``, which may be used to access the ``client.db`` |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
1450 when you need to perform arbitrary database queries. |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
1451 |
|
1124
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1452 Batching |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1453 :::::::: |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1454 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1455 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
|
1456 of batches. Its usage is:: |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1457 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1458 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
|
1459 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1460 or, to get the current index batch:: |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1461 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1462 request/batch |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1463 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1464 The parameters are: |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1465 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1466 ========= ================================================================== |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1467 Parameter Usage |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1468 ========= ================================================================== |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1469 sequence a list of HTMLItems |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1470 size how big to make the sequence. |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1471 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
|
1472 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
|
1473 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
|
1474 value, then it is combined with this batch |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1475 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
|
1476 ========= ================================================================== |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1477 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1478 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
|
1479 addition, it has several more attributes: |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1480 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1481 =============== ============================================================ |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1482 Attribute Description |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1483 =============== ============================================================ |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1484 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
|
1485 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
|
1486 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
|
1487 index* |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1488 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
|
1489 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
|
1490 =============== ============================================================ |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1491 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1492 And several methods: |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1493 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1494 =============== ============================================================ |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1495 Method Description |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1496 =============== ============================================================ |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1497 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
|
1498 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
|
1499 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
|
1500 when compared to the last item |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1501 =============== ============================================================ |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1502 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1503 An example of batching:: |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1504 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1505 <table class="otherinfo"> |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1506 <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
|
1507 <tr tal:define="keywords db/keyword/list" |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1508 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
|
1509 <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
|
1510 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
|
1511 </tr> |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1512 </table> |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1513 |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1514 ... 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
|
1515 "keyword" class (well, their "name" anyway). |
|
1fc1f92c5f31
more doc, bugfix in Batch
Richard Jones <richard@users.sourceforge.net>
parents:
1123
diff
changeset
|
1516 |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1517 Displaying Properties |
| 1098 | 1518 --------------------- |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1519 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1520 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
|
1521 editors, and as search arguments. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
1522 For each type of property, there are several display possibilities. |
|
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
1523 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
|
1524 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
|
1525 displayed in an editable field. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1526 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1527 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1528 Index Views |
| 1098 | 1529 ----------- |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1530 |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1531 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
|
1532 classes. The template used is "*classname*.index". |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1533 |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1534 Index View Specifiers |
| 1098 | 1535 ~~~~~~~~~~~~~~~~~~~~~ |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1536 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1537 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
|
1538 added for clarity):: |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1539 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1540 /issue?status=unread,in-progress,resolved& |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1541 topic=security,ui& |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1542 :group=+priority& |
| 1098 | 1543 :sort==activity& |
|
1073
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1544 :filters=status,topic& |
|
cf30c6cdca02
More documentation.
Richard Jones <richard@users.sourceforge.net>
parents:
1070
diff
changeset
|
1545 :columns=title,status,fixer |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1546 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1547 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
|
1548 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
|
1549 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
|
1550 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
|
1551 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
|
1552 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
|
1553 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
|
1554 the column headings in the table. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1555 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1556 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
|
1557 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
|
1558 matching any specified Multilink properties. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1559 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
1560 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
|
1561 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
|
1562 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
|
1563 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
|
1564 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
|
1565 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
|
1566 "title", "status", and "fixer" properties. |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1567 |
|
1057
8b9feca82090
some progress
Richard Jones <richard@users.sourceforge.net>
parents:
1003
diff
changeset
|
1568 Searching Views |
| 1098 | 1569 --------------- |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1570 |
|
1320
3758a5af985f
Lots of little fixes in this update:
Richard Jones <richard@users.sourceforge.net>
parents:
1317
diff
changeset
|
1571 Note: if you add a new column to the ``:columns`` form variable potentials |
|
1331
3b953be32cdc
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1328
diff
changeset
|
1572 then you will need to add the column to the appropriate `index views`_ |
|
1320
3758a5af985f
Lots of little fixes in this update:
Richard Jones <richard@users.sourceforge.net>
parents:
1317
diff
changeset
|
1573 template so it is actually displayed. |
|
3758a5af985f
Lots of little fixes in this update:
Richard Jones <richard@users.sourceforge.net>
parents:
1317
diff
changeset
|
1574 |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1575 This is one of the class context views. The template used is typically |
|
1245
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1576 "*classname*.search". The form on this page should have "search" as its |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1577 ``:action`` variable. The "search" action: |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1578 |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1579 - sets up additional filtering, as well as performing indexed text searching |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1580 - sets the ``:filter`` variable correctly |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1581 - saves the query off if ``:query_name`` is set. |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1582 |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1583 The searching page should lay out any fields that you wish to allow the user |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1584 to search one. If your schema contains a large number of properties, you |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1585 should be wary of making all of those properties available for searching, as |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1586 this can cause confusion. If the additional properties are Strings, consider |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1587 having their value indexed, and then they will be searchable using the full |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1588 text indexed search. This is both faster, and more useful for the end user. |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1589 |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1590 The two special form values on search pages which are handled by the "search" |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1591 action are: |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1592 |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1593 :search_text |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1594 Text to perform a search of the text index with. Results from that search |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1595 will be used to limit the results of other filters (using an intersection |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1596 operation) |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1597 :query_name |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1598 If supplied, the search parameters (including :search_text) will be saved |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1599 off as a the query item and registered against the user's queries property. |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1600 Note that the *classic* template schema has this ability, but the *minimal* |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1601 template schema does not. |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1602 |
|
d8c98af869ff
merge from maint-0-5
Richard Jones <richard@users.sourceforge.net>
parents:
1244
diff
changeset
|
1603 |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1604 Item Views |
| 1098 | 1605 ---------- |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1606 |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1607 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
|
1608 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
|
1609 "history" section. |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1610 |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1611 |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1612 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1613 Editor Section |
| 1098 | 1614 ~~~~~~~~~~~~~~ |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1615 |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1616 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
|
1617 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
|
1618 |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1619 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
|
1620 template issue item edit form - from the "issue.item" template):: |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1621 |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1622 <table class="form"> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1623 <tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1624 <th nowrap>Title</th> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1625 <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
|
1626 </tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1627 |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1628 <tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1629 <th nowrap>Priority</th> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1630 <td tal:content="structure context/priority/menu">priority</td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1631 <th nowrap>Status</th> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1632 <td tal:content="structure context/status/menu">status</td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1633 </tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1634 |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1635 <tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1636 <th nowrap>Superseder</th> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1637 <td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1638 <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
|
1639 <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
|
1640 <span tal:condition="context/superseder"> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1641 <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
|
1642 </span> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1643 </td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1644 <th nowrap>Nosy List</th> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1645 <td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1646 <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
|
1647 <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
|
1648 </td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1649 </tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1650 |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1651 <tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1652 <th nowrap>Assigned To</th> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1653 <td tal:content="structure context/assignedto/menu"> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1654 assignedto menu |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1655 </td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1656 <td> </td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1657 <td> </td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1658 </tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1659 |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1660 <tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1661 <th nowrap>Change Note</th> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1662 <td colspan=3> |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
1663 <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
|
1664 </td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1665 </tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1666 |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1667 <tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1668 <th nowrap>File</th> |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
1669 <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
|
1670 </tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1671 |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1672 <tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1673 <td> </td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1674 <td colspan=3 tal:content="structure context/submit"> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1675 submit button will go here |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1676 </td> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1677 </tr> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1678 </table> |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1679 |
|
673
604c84696461
link() htmltemplate function now has a "showid" option for links & multilinks.
Richard Jones <richard@users.sourceforge.net>
parents:
659
diff
changeset
|
1680 |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1681 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
|
1682 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
|
1683 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
|
1684 standard change note message generated by Roundup. |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1685 |
|
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1686 Spool Section |
| 1098 | 1687 ~~~~~~~~~~~~~ |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1688 |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1689 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
|
1690 an issue. |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1691 |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1692 TODO |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1693 |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1694 |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1695 History Section |
| 1098 | 1696 ~~~~~~~~~~~~~~~ |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1697 |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1698 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
|
1699 This is generally generated with the template:: |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1700 |
|
1074
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1701 <tal:block tal:replace="structure context/history" /> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1702 |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1703 *To be done:* |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1704 |
|
1089
43ab730ee194
instance -> tracker, node -> item
Richard Jones <richard@users.sourceforge.net>
parents:
1083
diff
changeset
|
1705 *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
|
1706 through the "journal" method of the item*:: |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1707 |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1708 <tal:block tal:repeat="entry context/journal"> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1709 a journal entry |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1710 </tal:block> |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1711 |
|
954ad22eb7d9
more doc, more cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
1073
diff
changeset
|
1712 *where each journal entry is an HTMLJournalEntry.* |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1713 |
| 1098 | 1714 Defining new web actions |
| 1715 ------------------------ | |
| 1716 | |
|
1244
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1717 You may define new actions to be triggered by the ``:action`` form variable. |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1718 These are added to the tracker ``interfaces.py`` as methods on the ``Client`` |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1719 class. |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1720 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1721 Adding action methods takes three steps; first you `define the new action |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1722 method`_, then you `register the action method`_ with the cgi interface so |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1723 it may be triggered by the ``:action`` form variable. Finally you actually |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1724 `use the new action`_ in your HTML form. |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1725 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1726 See "`setting up a "wizard" (or "druid") for controlled adding of issues`_" |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1727 for an example. |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1728 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1729 Define the new action method |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1730 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1731 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1732 The action methods have the following interface:: |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1733 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1734 def myActionMethod(self): |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1735 ''' Perform some action. No return value is required. |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1736 ''' |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1737 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1738 The *self* argument is an instance of your tracker ``instance.Client`` class - |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1739 thus it's mostly implemented by ``roundup.cgi.Client``. See the docstring of |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1740 that class for details of what it can do. |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1741 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1742 The method will typically check the ``self.form`` variable's contents. It |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1743 may then: |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1744 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1745 - add information to ``self.ok_message`` or ``self.error_message`` |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1746 - change the ``self.template`` variable to alter what the user will see next |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1747 - raise Unauthorised, SendStaticFile, SendFile, NotFound or Redirect |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1748 exceptions |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1749 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1750 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1751 Register the action method |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1752 ~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1753 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1754 The method is now written, but isn't available to the user until you add it to |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1755 the `instance.Client`` class ``actions`` variable, like so:: |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1756 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1757 actions = client.Class.actions + ( |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1758 ('myaction', 'myActionMethod'), |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1759 ) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1760 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1761 This maps the action name "myaction" to the action method we defined. |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1762 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1763 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1764 Use the new action |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1765 ~~~~~~~~~~~~~~~~~~ |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1766 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1767 In your HTML form, add a hidden form element like so:: |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1768 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1769 <input type="hidden" name=":action" value="myaction"> |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1770 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1771 where "myaction" is the name you registered in the previous step. |
|
1003
f89b8d32291b
Hack hack hack...
Richard Jones <richard@users.sourceforge.net>
parents:
935
diff
changeset
|
1772 |
|
910
299f4890427d
documentation reorg post-new-security
Richard Jones <richard@users.sourceforge.net>
parents:
909
diff
changeset
|
1773 |
| 1100 | 1774 Examples |
| 1775 ======== | |
| 1776 | |
|
1244
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1777 .. contents:: |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1778 :local: |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1779 :depth: 1 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
1780 |
| 1228 | 1781 Adding a new field to the classic schema |
| 1782 ---------------------------------------- | |
| 1100 | 1783 |
| 1784 This example shows how to add a new constrained property (ie. a selection of | |
| 1785 distinct values) to your tracker. | |
| 1098 | 1786 |
| 1787 Introduction | |
| 1100 | 1788 ~~~~~~~~~~~~ |
| 1098 | 1789 |
| 1790 To make the classic schema of roundup useful as a todo tracking system | |
| 1791 for a group of systems administrators, it needed an extra data field | |
| 1792 per issue: a category. | |
| 1793 | |
| 1794 This would let sysads quickly list all todos in their particular | |
| 1795 area of interest without having to do complex queries, and without | |
| 1796 relying on the spelling capabilities of other sysads (a losing | |
| 1797 proposition at best). | |
| 1798 | |
| 1799 Adding a field to the database | |
| 1100 | 1800 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1098 | 1801 |
| 1802 This is the easiest part of the change. The category would just be a plain | |
| 1803 string, nothing fancy. To change what is in the database you need to add | |
|
1235
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1804 some lines to the ``open()`` function in ``dbinit.py`` under the comment:: |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1805 |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1806 # add any additional database schema configuration here |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1807 |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1808 add:: |
| 1098 | 1809 |
| 1810 category = Class(db, "category", name=String()) | |
| 1811 category.setkey("name") | |
| 1812 | |
| 1813 Here we are setting up a chunk of the database which we are calling | |
| 1814 "category". It contains a string, which we are refering to as "name" for | |
| 1815 lack of a more imaginative title. Then we are setting the key of this chunk | |
| 1816 of the database to be that "name". This is equivalent to an index for | |
| 1817 database types. This also means that there can only be one category with a | |
| 1818 given name. | |
| 1819 | |
| 1820 Adding the above lines allows us to create categories, but they're not tied | |
| 1821 to the issues that we are going to be creating. It's just a list of categories | |
| 1822 off on its own, which isn't much use. We need to link it in with the issues. | |
| 1823 To do that, find the lines in the ``open()`` function in ``dbinit.py`` which | |
| 1824 set up the "issue" class, and then add a link to the category:: | |
| 1825 | |
| 1826 issue = IssueClass(db, "issue", ... , category=Multilink("category"), ... ) | |
| 1827 | |
| 1828 The Multilink() means that each issue can have many categories. If you were | |
| 1829 adding something with a more one to one relationship use Link() instead. | |
| 1830 | |
| 1831 That is all you need to do to change the schema. The rest of the effort is | |
| 1832 fiddling around so you can actually use the new category. | |
| 1833 | |
|
1235
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1834 Populating the new category class |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1835 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1836 |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1837 If you haven't initialised the database with the roundup-admin "initialise" |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1838 command, then you can add the following to the tracker ``dbinit.py`` in the |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1839 ``init()`` function under the comment:: |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1840 |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1841 # add any additional database create steps here - but only if you |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1842 # haven't initialised the database with the admin "initialise" command |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1843 |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1844 add:: |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1845 |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1846 category = db.getclass('category') |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1847 category.create(name="scipy", order="1") |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1848 category.create(name="chaco", order="2") |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1849 category.create(name="weave", order="3") |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1850 |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1851 If the database is initalised, the you need to use the roundup-admin tool:: |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1852 |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1853 % roundup-admin -i <tracker home> |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1854 Roundup <version> ready for input. |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1855 Type "help" for help. |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1856 roundup> create category name=scipy order=1 |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1857 1 |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1858 roundup> create category name=chaco order=1 |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1859 2 |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1860 roundup> create category name=weave order=1 |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1861 3 |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1862 roundup> exit... |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1863 There are unsaved changes. Commit them (y/N)? y |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1864 |
|
7441653e5330
added hook for external password validation, and some more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1234
diff
changeset
|
1865 |
| 1098 | 1866 Setting up security on the new objects |
| 1100 | 1867 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1098 | 1868 |
| 1869 By default only the admin user can look at and change objects. This doesn't | |
| 1870 suit us, as we want any user to be able to create new categories as | |
| 1871 required, and obviously everyone needs to be able to view the categories of | |
| 1872 issues for it to be useful. | |
| 1873 | |
| 1874 We therefore need to change the security of the category objects. This is | |
| 1875 also done in the ``open()`` function of ``dbinit.py``. | |
| 1876 | |
| 1877 There are currently two loops which set up permissions and then assign them | |
| 1878 to various roles. Simply add the new "category" to both lists:: | |
| 1879 | |
| 1880 # new permissions for this schema | |
| 1881 for cl in 'issue', 'file', 'msg', 'user', 'category': | |
| 1882 db.security.addPermission(name="Edit", klass=cl, | |
| 1883 description="User is allowed to edit "+cl) | |
| 1884 db.security.addPermission(name="View", klass=cl, | |
| 1885 description="User is allowed to access "+cl) | |
| 1886 | |
| 1887 # Assign the access and edit permissions for issue, file and message | |
| 1888 # to regular users now | |
| 1889 for cl in 'issue', 'file', 'msg', 'category': | |
| 1890 p = db.security.getPermission('View', cl) | |
| 1891 db.security.addPermissionToRole('User', p) | |
| 1892 p = db.security.getPermission('Edit', cl) | |
| 1893 db.security.addPermissionToRole('User', p) | |
| 1894 | |
| 1895 So you are in effect doing the following:: | |
| 1896 | |
| 1897 db.security.addPermission(name="Edit", klass='category', | |
| 1898 description="User is allowed to edit "+'category') | |
| 1899 db.security.addPermission(name="View", klass='category', | |
| 1900 description="User is allowed to access "+'category') | |
| 1901 | |
| 1902 which is creating two permission types; that of editing and viewing | |
| 1903 "category" objects respectively. Then the following lines assign those new | |
| 1904 permissions to the "User" role, so that normal users can view and edit | |
| 1905 "category" objects:: | |
| 1906 | |
| 1907 p = db.security.getPermission('View', 'category') | |
| 1908 db.security.addPermissionToRole('User', p) | |
| 1909 | |
| 1910 p = db.security.getPermission('Edit', 'category') | |
| 1911 db.security.addPermissionToRole('User', p) | |
| 1912 | |
| 1913 This is all the work that needs to be done for the database. It will store | |
| 1914 categories, and let users view and edit them. Now on to the interface | |
| 1915 stuff. | |
| 1916 | |
| 1917 Changing the web left hand frame | |
| 1100 | 1918 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1098 | 1919 |
| 1920 We need to give the users the ability to create new categories, and the | |
| 1921 place to put the link to this functionality is in the left hand function | |
| 1922 bar, under the "Issues" area. The file that defines how this area looks is | |
| 1923 ``html/page``, which is what we are going to be editing next. | |
| 1924 | |
| 1925 If you look at this file you can see that it contains a lot of "classblock" | |
| 1926 sections which are chunks of HTML that will be included or excluded in the | |
| 1927 output depending on whether the condition in the classblock is met. Under | |
| 1928 the end of the classblock for issue is where we are going to add the | |
| 1929 category code:: | |
| 1930 | |
| 1931 <p class="classblock" | |
| 1932 tal:condition="python:request.user.hasPermission('View', 'category')"> | |
| 1933 <b>Categories</b><br> | |
| 1934 <a tal:condition="python:request.user.hasPermission('Edit', 'category')" | |
| 1935 href="category?:template=item">New Category<br></a> | |
| 1936 </p> | |
| 1937 | |
| 1938 The first two lines is the classblock definition, which sets up a condition | |
| 1939 that only users who have "View" permission to the "category" object will | |
| 1940 have this section included in their output. Next comes a plain "Categories" | |
| 1941 header in bold. Everyone who can view categories will get that. | |
| 1942 | |
| 1943 Next comes the link to the editing area of categories. This link will only | |
| 1944 appear if the condition is matched: that condition being that the user has | |
| 1945 "Edit" permissions for the "category" objects. If they do have permission | |
| 1946 then they will get a link to another page which will let the user add new | |
| 1947 categories. | |
| 1948 | |
| 1949 Note that if you have permission to view but not edit categories then all | |
| 1950 you will see is a "Categories" header with nothing underneath it. This is | |
| 1951 obviously not very good interface design, but will do for now. I just claim | |
| 1952 that it is so I can add more links in this section later on. However to fix | |
| 1953 the problem you could change the condition in the classblock statement, so | |
| 1954 that only users with "Edit" permission would see the "Categories" stuff. | |
| 1955 | |
| 1956 Setting up a page to edit categories | |
| 1100 | 1957 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1098 | 1958 |
| 1959 We defined code in the previous section which let users with the | |
| 1960 appropriate permissions see a link to a page which would let them edit | |
| 1961 conditions. Now we have to write that page. | |
| 1962 | |
| 1963 The link was for the item template for the category object. This translates | |
| 1964 into the system looking for a file called ``category.item`` in the ``html`` | |
| 1965 tracker directory. This is the file that we are going to write now. | |
| 1966 | |
|
1213
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1967 First we add an info tag in a comment which doesn't affect the outcome |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1968 of the code at all but is useful for debugging. If you load a page in a |
| 1098 | 1969 browser and look at the page source, you can see which sections come |
| 1970 from which files by looking for these comments:: | |
| 1971 | |
|
1213
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1972 <!-- category.item --> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1973 |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1974 Next we need to add in the METAL macro stuff so we get the normal page |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1975 trappings:: |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1976 |
| 1214 | 1977 <tal:block metal:use-macro="templates/page/macros/icing"> |
|
1213
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1978 <title metal:fill-slot="head_title">Category editing</title> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1979 <td class="page-header-top" metal:fill-slot="body_title"> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1980 <h2>Category editing</h2> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1981 </td> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
1982 <td class="content" metal:fill-slot="content"> |
| 1098 | 1983 |
| 1984 Next we need to setup up a standard HTML form, which is the whole | |
| 1985 purpose of this file. We link to some handy javascript which sends the form | |
| 1986 through only once. This is to stop users hitting the send button | |
| 1987 multiple times when they are impatient and thus having the form sent | |
| 1988 multiple times:: | |
| 1989 | |
| 1990 <form method="POST" onSubmit="return submit_once()" | |
| 1991 enctype="multipart/form-data"> | |
| 1992 | |
| 1993 Next we define some code which sets up the minimum list of fields that we | |
| 1994 require the user to enter. There will be only one field, that of "name", so | |
| 1995 they user better put something in it otherwise the whole form is pointless:: | |
| 1996 | |
| 1997 <input type="hidden" name=":required" value="name"> | |
| 1998 | |
| 1999 To get everything to line up properly we will put everything in a table, | |
| 2000 and put a nice big header on it so the user has an idea what is happening:: | |
| 2001 | |
| 2002 <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
|
2003 <tr><th class="header" colspan=2>Category</th></tr> |
| 1098 | 2004 |
| 2005 Next we need the actual field that the user is going to enter the new | |
| 2006 category. The "context.name.field(size=60)" bit tells roundup to generate a | |
| 2007 normal HTML field of size 60, and the contents of that field will be the | |
| 2008 "name" variable of the current context (which is "category"). The upshot of | |
| 2009 this is that when the user types something in to the form, a new category | |
| 2010 will be created with that name:: | |
| 2011 | |
| 2012 <tr> | |
|
1113
a95428868bf4
Added the missing keyword/topic interface to classic template (blush)
Richard Jones <richard@users.sourceforge.net>
parents:
1100
diff
changeset
|
2013 <th nowrap>Name</th> |
| 1098 | 2014 <td tal:content="structure python:context.name.field(size=60)">name</td> |
| 2015 </tr> | |
| 2016 | |
|
1213
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2017 Then a submit button so that the user can submit the new category:: |
| 1098 | 2018 |
| 2019 <tr> | |
| 2020 <td> </td> | |
| 2021 <td colspan=3 tal:content="structure context/submit"> | |
| 2022 submit button will go here | |
| 2023 </td> | |
| 2024 </tr> | |
| 2025 | |
|
1213
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2026 Finally we finish off the tags we used at the start to do the METAL stuff:: |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2027 |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2028 </td> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2029 </tal:block> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2030 |
| 1098 | 2031 So putting it all together, and closing the table and form we get:: |
| 2032 | |
|
1213
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2033 <!-- category.item --> |
| 1214 | 2034 <tal:block metal:use-macro="templates/page/macros/icing"> |
|
1213
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2035 <title metal:fill-slot="head_title">Category editing</title> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2036 <td class="page-header-top" metal:fill-slot="body_title"> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2037 <h2>Category editing</h2> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2038 </td> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2039 <td class="content" metal:fill-slot="content"> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2040 <form method="POST" onSubmit="return submit_once()" |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2041 enctype="multipart/form-data"> |
| 1098 | 2042 |
|
1213
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2043 <input type="hidden" name=":required" value="name"> |
| 1098 | 2044 |
|
1213
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2045 <table class="form"> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2046 <tr><th class="header" colspan=2>Category</th></tr> |
| 1098 | 2047 |
|
1213
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2048 <tr> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2049 <th nowrap>Name</th> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2050 <td tal:content="structure python:context.name.field(size=60)">name</td> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2051 </tr> |
| 1098 | 2052 |
|
1213
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2053 <tr> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2054 <td> </td> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2055 <td colspan=3 tal:content="structure context/submit"> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2056 submit button will go here |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2057 </td> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2058 </tr> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2059 </table> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2060 </form> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2061 </td> |
|
3a5e05edcd87
added doc for METAL
Richard Jones <richard@users.sourceforge.net>
parents:
1164
diff
changeset
|
2062 </tal:block> |
| 1098 | 2063 |
| 2064 This is quite a lot to just ask the user one simple question, but | |
| 2065 there is a lot of setup for basically one line (the form line) to do | |
| 2066 its work. To add another field to "category" would involve one more line | |
| 2067 (well maybe a few extra to get the formatting correct). | |
| 2068 | |
| 2069 Adding the category to the issue | |
| 1100 | 2070 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1098 | 2071 |
| 2072 We now have the ability to create issues to our hearts content, but | |
| 2073 that is pointless unless we can assign categories to issues. Just like | |
| 2074 the ``html/category.item`` file was used to define how to add a new | |
| 2075 category, the ``html/issue.item`` is used to define how a new issue is | |
| 2076 created. | |
| 2077 | |
| 2078 Just like ``category.issue`` this file defines a form which has a table to lay | |
| 2079 things out. It doesn't matter where in the table we add new stuff, | |
| 2080 it is entirely up to your sense of aesthetics:: | |
| 2081 | |
| 2082 <th nowrap>Category</th> | |
| 2083 <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
|
2084 <span tal:replace="structure db/category/classhelp" /> |
| 1098 | 2085 </td> |
| 2086 | |
| 2087 First we define a nice header so that the user knows what the next section | |
| 2088 is, then the middle line does what we are most interested in. This | |
| 2089 ``context/category/field`` gets replaced with a field which contains the | |
| 2090 category in the current context (the current context being the new issue). | |
| 2091 | |
| 2092 The classhelp lines generate a link (labelled "list") to a popup window | |
| 2093 which contains the list of currently known categories. | |
| 2094 | |
| 2095 Searching on categories | |
| 1100 | 2096 ~~~~~~~~~~~~~~~~~~~~~~~ |
| 1098 | 2097 |
| 2098 We can add categories, and create issues with categories. The next obvious | |
| 2099 thing that we would like to be would be to search issues based on their | |
| 2100 category, so that any one working on the web server could look at all | |
| 2101 issues in the category "Web" for example. | |
| 2102 | |
| 2103 If you look in the html/page file and look for the "Search Issues" you will | |
| 2104 see that it looks something like ``<a href="issue?:template=search">Search | |
| 2105 Issues</a>`` which shows us that when you click on "Search Issues" it will | |
| 2106 be looking for a ``issue.search`` file to display. So that is indeed the file | |
| 2107 that we are going to change. | |
| 2108 | |
| 2109 If you look at this file it should be starting to seem familiar. It is a | |
| 2110 simple HTML form using a table to define structure. You can add the new | |
| 2111 category search code anywhere you like within that form:: | |
| 2112 | |
| 2113 <tr> | |
| 2114 <th>Category:</th> | |
| 2115 <td> | |
| 2116 <select name="category"> | |
| 2117 <option value="">don't care</option> | |
| 2118 <option value="">------------</option> | |
| 2119 <option tal:repeat="s db/category/list" tal:attributes="value s/name" | |
| 2120 tal:content="s/name">category to filter on</option> | |
| 2121 </select> | |
| 2122 </td> | |
| 2123 <td><input type="checkbox" name=":columns" value="category" checked></td> | |
| 2124 <td><input type="radio" name=":sort" value="category"></td> | |
| 2125 <td><input type="radio" name=":group" value="category"></td> | |
| 2126 </tr> | |
| 2127 | |
| 2128 Most of this is straightforward to anyone who knows HTML. It is just | |
| 2129 setting up a select list followed by a checkbox and a couple of radio | |
| 2130 buttons. | |
| 2131 | |
| 2132 The ``tal:repeat`` part repeats the tag for every item in the "category" | |
| 2133 table and setting "s" to be each category in turn. | |
| 2134 | |
| 2135 The ``tal:attributes`` part is setting up the ``value=`` part of the option tag | |
| 2136 to be the name part of "s" which is the current category in the loop. | |
| 2137 | |
| 2138 The ``tal:content`` part is setting the contents of the option tag to be the | |
| 2139 name part of "s" again. For objects more complex than category, obviously | |
| 2140 you would put an id in the value, and the descriptive part in the content; | |
| 2141 but for category they are the same. | |
| 2142 | |
| 2143 Adding category to the default view | |
| 1100 | 2144 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1098 | 2145 |
| 2146 We can now add categories, add issues with categories, and search issues | |
| 2147 based on categories. This is everything that we need to do, however there | |
| 2148 is some more icing that we would like. I think the category of an issue is | |
| 2149 important enough that it should be displayed by default when listing all | |
| 2150 the issues. | |
| 2151 | |
| 2152 Unfortunately, this is a bit less obvious than the previous steps. The code | |
| 2153 defining how the issues look is in ``html/issue.index``. This is a large table | |
| 2154 with a form down the bottom for redisplaying and so forth. | |
| 2155 | |
| 2156 Firstly we need to add an appropriate header to the start of the table:: | |
| 2157 | |
| 2158 <th tal:condition="request/show/category">Category</th> | |
| 2159 | |
| 2160 The condition part of this statement is so that if the user has selected | |
| 2161 not to see the Category column then they won't. | |
| 2162 | |
| 2163 The rest of the table is a loop which will go through every issue that | |
| 2164 matches the display criteria. The loop variable is "i" - which means that | |
| 2165 every issue gets assigned to "i" in turn. | |
| 2166 | |
| 2167 The new part of code to display the category will look like this:: | |
| 2168 | |
| 2169 <td tal:condition="request/show/category" tal:content="i/category"></td> | |
| 2170 | |
| 2171 The condition is the same as above: only display the condition when the | |
| 2172 user hasn't asked for it to be hidden. The next part is to set the content | |
| 2173 of the cell to be the category part of "i" - the current issue. | |
| 2174 | |
| 2175 Finally we have to edit ``html/page`` again. This time to tell it that when the | |
| 2176 user clicks on "Unnasigned Issues" or "All Issues" that the category should | |
| 2177 be displayed. If you scroll down the page file, you can see the links with | |
| 2178 lots of options. The option that we are interested in is the ``:columns=`` one | |
| 2179 which tells roundup which fields of the issue to display. Simply add | |
| 2180 "category" to that list and it all should work. | |
| 2181 | |
| 2182 | |
| 1100 | 2183 Adding in state transition control |
| 2184 ---------------------------------- | |
| 2185 | |
| 2186 Sometimes tracker admins want to control the states that users may move issues | |
| 2187 to. | |
| 2188 | |
| 2189 1. add a Multilink property to the status class:: | |
| 2190 | |
| 2191 stat = Class(db, "status", ... , transitions=Multilink('status'), ...) | |
| 2192 | |
|
1255
e5af1b963837
minor doc fix
Richard Jones <richard@users.sourceforge.net>
parents:
1254
diff
changeset
|
2193 and then edit the statuses already created either: |
|
e5af1b963837
minor doc fix
Richard Jones <richard@users.sourceforge.net>
parents:
1254
diff
changeset
|
2194 |
|
e5af1b963837
minor doc fix
Richard Jones <richard@users.sourceforge.net>
parents:
1254
diff
changeset
|
2195 a. through the web using the class list -> status class editor, or |
|
e5af1b963837
minor doc fix
Richard Jones <richard@users.sourceforge.net>
parents:
1254
diff
changeset
|
2196 b. using the roundup-admin "set" command. |
| 1100 | 2197 |
| 2198 2. add an auditor module ``checktransition.py`` in your tracker's | |
| 2199 ``detectors`` directory:: | |
| 2200 | |
| 2201 def checktransition(db, cl, nodeid, newvalues): | |
| 2202 ''' Check that the desired transition is valid for the "status" | |
| 2203 property. | |
| 2204 ''' | |
| 2205 if not newvalues.has_key('status'): | |
| 2206 return | |
| 2207 current = cl.get(nodeid, 'status') | |
| 2208 new = newvalues['status'] | |
| 2209 if new == current: | |
| 2210 return | |
| 2211 ok = db.status.get(current, 'transitions') | |
| 2212 if new not in ok: | |
| 2213 raise ValueError, 'Status not allowed to move from "%s" to "%s"'%( | |
| 2214 db.status.get(current, 'name'), db.status.get(new, 'name')) | |
| 2215 | |
| 2216 def init(db): | |
| 2217 db.issue.audit('set', checktransition) | |
| 2218 | |
| 2219 3. in the ``issue.item`` template, change the status editing bit from:: | |
| 2220 | |
| 2221 <th nowrap>Status</th> | |
| 2222 <td tal:content="structure context/status/menu">status</td> | |
| 2223 | |
| 2224 to:: | |
| 2225 | |
| 2226 <th nowrap>Status</th> | |
| 2227 <td> | |
| 2228 <select tal:condition="context/id" name="status"> | |
| 2229 <tal:block tal:define="ok context/status/transitions" | |
| 2230 tal:repeat="state db/status/list"> | |
| 2231 <option tal:condition="python:state.id in ok" | |
| 2232 tal:attributes="value state/id; | |
| 2233 selected python:state.id == context.status.id" | |
| 2234 tal:content="state/name"></option> | |
| 2235 </tal:block> | |
| 2236 </select> | |
| 2237 <tal:block tal:condition="not:context/id" | |
| 2238 tal:replace="structure context/status/menu" /> | |
| 2239 </td> | |
| 2240 | |
| 2241 which displays only the allowed status to transition to. | |
| 2242 | |
| 2243 | |
|
1304
61ad556cfc8d
working toward 0.5.2 release
Richard Jones <richard@users.sourceforge.net>
parents:
1299
diff
changeset
|
2244 Displaying only message summaries in the issue display |
|
61ad556cfc8d
working toward 0.5.2 release
Richard Jones <richard@users.sourceforge.net>
parents:
1299
diff
changeset
|
2245 ------------------------------------------------------ |
|
1133
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
2246 |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
2247 Alter the issue.item template section for messages to:: |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
2248 |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
2249 <table class="messages" tal:condition="context/messages"> |
|
1304
61ad556cfc8d
working toward 0.5.2 release
Richard Jones <richard@users.sourceforge.net>
parents:
1299
diff
changeset
|
2250 <tr><th colspan=5 class="header">Messages</th></tr> |
|
61ad556cfc8d
working toward 0.5.2 release
Richard Jones <richard@users.sourceforge.net>
parents:
1299
diff
changeset
|
2251 <tr tal:repeat="msg context/messages"> |
|
61ad556cfc8d
working toward 0.5.2 release
Richard Jones <richard@users.sourceforge.net>
parents:
1299
diff
changeset
|
2252 <td><a tal:attributes="href string:msg${msg/id}" |
|
61ad556cfc8d
working toward 0.5.2 release
Richard Jones <richard@users.sourceforge.net>
parents:
1299
diff
changeset
|
2253 tal:content="string:msg${msg/id}"></a></td> |
|
61ad556cfc8d
working toward 0.5.2 release
Richard Jones <richard@users.sourceforge.net>
parents:
1299
diff
changeset
|
2254 <td tal:content="msg/author">author</td> |
|
61ad556cfc8d
working toward 0.5.2 release
Richard Jones <richard@users.sourceforge.net>
parents:
1299
diff
changeset
|
2255 <td nowrap tal:content="msg/date/pretty">date</td> |
|
61ad556cfc8d
working toward 0.5.2 release
Richard Jones <richard@users.sourceforge.net>
parents:
1299
diff
changeset
|
2256 <td tal:content="msg/summary">summary</td> |
|
61ad556cfc8d
working toward 0.5.2 release
Richard Jones <richard@users.sourceforge.net>
parents:
1299
diff
changeset
|
2257 <td> |
|
61ad556cfc8d
working toward 0.5.2 release
Richard Jones <richard@users.sourceforge.net>
parents:
1299
diff
changeset
|
2258 <a tal:attributes="href string:?:remove:messages=${msg/id}&:action=edit">remove</a> |
|
61ad556cfc8d
working toward 0.5.2 release
Richard Jones <richard@users.sourceforge.net>
parents:
1299
diff
changeset
|
2259 </td> |
|
61ad556cfc8d
working toward 0.5.2 release
Richard Jones <richard@users.sourceforge.net>
parents:
1299
diff
changeset
|
2260 </tr> |
|
1133
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
2261 </table> |
|
36ec30d286ea
Cleaned up CHANGES/TODO
Richard Jones <richard@users.sourceforge.net>
parents:
1125
diff
changeset
|
2262 |
|
1147
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
2263 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
|
2264 ----------------------------------------------------------- |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
2265 |
| 1150 | 2266 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
|
2267 |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
2268 db.security.addRole(name='Developer', description='A developer') |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
2269 |
| 1150 | 2270 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
|
2271 |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
2272 p = db.security.addPermission(name='Fixer', klass='issue', |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
2273 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
|
2274 |
| 1150 | 2275 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
|
2276 |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
2277 db.security.addPermissionToRole('Developer', p) |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
2278 |
| 1150 | 2279 4. In the issue item edit page ("html/issue.item" in your tracker dir), use |
| 2280 the new Permission in restricting the "assignedto" list:: | |
|
1147
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
2281 |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
2282 <select name="assignedto"> |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
2283 <option value="-1">- no selection -</option> |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
2284 <tal:block tal:repeat="user db/user/list"> |
| 1457 | 2285 <option tal:condition="python:user.hasPermission('Fixer', context._classname)" |
|
1147
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
2286 tal:attributes="value user/id; |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
2287 selected python:user.id == context.assignedto" |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
2288 tal:content="user/realname"></option> |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
2289 </tal:block> |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
2290 </select> |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
2291 |
| 1149 | 2292 For extra security, you may wish to set up an auditor to enforce the |
| 1150 | 2293 Permission requirement (install this as "assignedtoFixer.py" in your tracker |
| 2294 "detectors" directory):: | |
|
1147
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
2295 |
| 1149 | 2296 def assignedtoMustBeFixer(db, cl, nodeid, newvalues): |
| 2297 ''' Ensure the assignedto value in newvalues is a used with the Fixer | |
| 2298 Permission | |
| 2299 ''' | |
| 2300 if not newvalues.has_key('assignedto'): | |
| 2301 # don't care | |
| 2302 return | |
| 2303 | |
| 2304 # get the userid | |
| 2305 userid = newvalues['assignedto'] | |
| 2306 if not db.security.hasPermission('Fixer', userid, cl.classname): | |
| 2307 raise ValueError, 'You do not have permission to edit %s'%cl.classname | |
| 2308 | |
| 2309 def init(db): | |
| 2310 db.issue.audit('set', assignedtoMustBeFixer) | |
| 2311 db.issue.audit('create', assignedtoMustBeFixer) | |
| 2312 | |
| 2313 So now, if the edit attempts to set the assignedto to a user that doesn't have | |
| 2314 the "Fixer" Permission, the error will be raised. | |
|
1147
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
2315 |
|
89b1a8a468e7
more doc, "fixer" example
Richard Jones <richard@users.sourceforge.net>
parents:
1144
diff
changeset
|
2316 |
|
1151
7e0024954954
making it easier to add new actions, and more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1150
diff
changeset
|
2317 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
|
2318 ------------------------------------------------------------------ |
|
7e0024954954
making it easier to add new actions, and more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1150
diff
changeset
|
2319 |
|
1154
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2320 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
|
2321 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
|
2322 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
|
2323 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
|
2324 category names mean, and then the core of the form:: |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2325 |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2326 <form method="POST" onSubmit="return submit_once()" |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2327 enctype="multipart/form-data"> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2328 <input type="hidden" name=":template" value="add_page1"> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2329 <input type="hidden" name=":action" value="page1submit"> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2330 |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2331 <strong>Category:</strong> |
|
1156
d0da32fbdedc
gadfly backend now complete
Richard Jones <richard@users.sourceforge.net>
parents:
1154
diff
changeset
|
2332 <tal:block tal:replace="structure context/category/menu" /> |
|
1154
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2333 <input type="submit" value="Continue"> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2334 </form> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2335 |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2336 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
|
2337 the following form fragments:: |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2338 |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2339 <form method="POST" onSubmit="return submit_once()" |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2340 enctype="multipart/form-data" tal:condition="context/is_edit_ok" |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2341 tal:define="cat request/form/category/value"> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2342 |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2343 <input type="hidden" name=":template" value="add_page2"> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2344 <input type="hidden" name=":required" value="title"> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2345 <input type="hidden" name="category" tal:attributes="value cat"> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2346 |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2347 . |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2348 . |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2349 . |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2350 </form> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2351 |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2352 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
|
2353 elements that are appropriate. For example:: |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2354 |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2355 <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
|
2356 <tr> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2357 <th nowrap>Operating System</th> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2358 <td tal:content="structure context/os/field"></td> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2359 </tr> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2360 <tr> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2361 <th nowrap>Web Browser</th> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2362 <td tal:content="structure context/browser/field"></td> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2363 </tr> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2364 </tal:block> |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2365 |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2366 ... 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
|
2367 10, 13, 14, 15, 16 or 17. |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2368 |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2369 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
|
2370 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
|
2371 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
|
2372 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
|
2373 |
| 1262 | 2374 actions = client.Client.actions + ( |
|
1244
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2375 ('page1_submit', 'page1SubmitAction'), |
|
1151
7e0024954954
making it easier to add new actions, and more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1150
diff
changeset
|
2376 ) |
|
7e0024954954
making it easier to add new actions, and more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1150
diff
changeset
|
2377 |
|
7e0024954954
making it easier to add new actions, and more docco
Richard Jones <richard@users.sourceforge.net>
parents:
1150
diff
changeset
|
2378 def page1SubmitAction(self): |
|
1154
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2379 ''' 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
|
2380 to page 2. |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2381 ''' |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2382 category = self.form['category'].value |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2383 if category == '-1': |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2384 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
|
2385 return |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2386 # everything's ok, move on to the next page |
|
e0142ee233e8
more wizard example
Richard Jones <richard@users.sourceforge.net>
parents:
1151
diff
changeset
|
2387 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
|
2388 |
| 1164 | 2389 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
|
2390 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
|
2391 |
| 1236 | 2392 |
| 2393 Using an external password validation source | |
| 2394 -------------------------------------------- | |
| 2395 | |
| 2396 We have a centrally-managed password changing system for our users. This | |
| 2397 results in a UN*X passwd-style file that we use for verification of users. | |
| 2398 Entries in the file consist of ``name:password`` where the password is | |
| 2399 encrypted using the standard UN*X ``crypt()`` function (see the ``crypt`` | |
| 2400 module in your Python distribution). An example entry would be:: | |
| 2401 | |
| 2402 admin:aamrgyQfDFSHw | |
| 2403 | |
| 2404 Each user of Roundup must still have their information stored in the Roundup | |
| 2405 database - we just use the passwd file to check their password. To do this, we | |
| 2406 add the following code to our ``Client`` class in the tracker home | |
| 2407 ``interfaces.py`` module:: | |
| 2408 | |
| 2409 def verifyPassword(self, userid, password): | |
| 2410 # get the user's username | |
| 2411 username = self.db.user.get(userid, 'username') | |
| 2412 | |
| 2413 # the passwords are stored in the "passwd.txt" file in the tracker | |
| 2414 # home | |
| 2415 file = os.path.join(self.db.config.TRACKER_HOME, 'passwd.txt') | |
| 2416 | |
| 2417 # see if we can find a match | |
| 2418 for ent in [line.strip().split(':') for line in open(file).readlines()]: | |
| 2419 if ent[0] == username: | |
| 2420 return crypt.crypt(password, ent[1][:2]) == ent[1] | |
| 2421 | |
| 2422 # user doesn't exist in the file | |
| 2423 return 0 | |
| 2424 | |
| 2425 What this does is look through the file, line by line, looking for a name that | |
| 2426 matches. | |
| 2427 | |
| 2428 We also remove the redundant password fields from the ``user.item`` template. | |
| 2429 | |
| 2430 | |
|
1244
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2431 Adding a "vacation" flag to users for stopping nosy messages |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2432 ------------------------------------------------------------ |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2433 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2434 When users go on vacation and set up vacation email bouncing, you'll start to |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2435 see a lot of messages come back through Roundup "Fred is on vacation". Not |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2436 very useful, and relatively easy to stop. |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2437 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2438 1. add a "vacation" flag to your users:: |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2439 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2440 user = Class(db, "user", |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2441 username=String(), password=Password(), |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2442 address=String(), realname=String(), |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2443 phone=String(), organisation=String(), |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2444 alternate_addresses=String(), |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2445 roles=String(), queries=Multilink("query"), |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2446 vacation=Boolean()) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2447 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2448 2. edit your detector ``nosyreactor.py`` so that the ``nosyreaction()`` |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2449 consists of:: |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2450 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2451 def nosyreaction(db, cl, nodeid, oldvalues): |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2452 # send a copy of all new messages to the nosy list |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2453 for msgid in determineNewMessages(cl, nodeid, oldvalues): |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2454 try: |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2455 users = db.user |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2456 messages = db.msg |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2457 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2458 # figure the recipient ids |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2459 sendto = [] |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2460 r = {} |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2461 recipients = messages.get(msgid, 'recipients') |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2462 for recipid in messages.get(msgid, 'recipients'): |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2463 r[recipid] = 1 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2464 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2465 # figure the author's id, and indicate they've received the |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2466 # message |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2467 authid = messages.get(msgid, 'author') |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2468 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2469 # possibly send the message to the author, as long as they aren't |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2470 # anonymous |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2471 if (db.config.MESSAGES_TO_AUTHOR == 'yes' and |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2472 users.get(authid, 'username') != 'anonymous'): |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2473 sendto.append(authid) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2474 r[authid] = 1 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2475 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2476 # now figure the nosy people who weren't recipients |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2477 nosy = cl.get(nodeid, 'nosy') |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2478 for nosyid in nosy: |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2479 # Don't send nosy mail to the anonymous user (that user |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2480 # shouldn't appear in the nosy list, but just in case they |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2481 # do...) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2482 if users.get(nosyid, 'username') == 'anonymous': |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2483 continue |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2484 # make sure they haven't seen the message already |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2485 if not r.has_key(nosyid): |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2486 # send it to them |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2487 sendto.append(nosyid) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2488 recipients.append(nosyid) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2489 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2490 # generate a change note |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2491 if oldvalues: |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2492 note = cl.generateChangeNote(nodeid, oldvalues) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2493 else: |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2494 note = cl.generateCreateNote(nodeid) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2495 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2496 # we have new recipients |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2497 if sendto: |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2498 # filter out the people on vacation |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2499 sendto = [i for i in sendto if not users.get(i, 'vacation', 0)] |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2500 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2501 # map userids to addresses |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2502 sendto = [users.get(i, 'address') for i in sendto] |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2503 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2504 # update the message's recipients list |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2505 messages.set(msgid, recipients=recipients) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2506 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2507 # send the message |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2508 cl.send_message(nodeid, msgid, note, sendto) |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2509 except roundupdb.MessageSendError, message: |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2510 raise roundupdb.DetectorError, message |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2511 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2512 Note that this is the standard nosy reaction code, with the small addition |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2513 of:: |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2514 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2515 # filter out the people on vacation |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2516 sendto = [i for i in sendto if not users.get(i, 'vacation', 0)] |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2517 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2518 which filters out the users that have the vacation flag set to true. |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2519 |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2520 |
| 1262 | 2521 Adding a time log to your issues |
| 2522 -------------------------------- | |
| 2523 | |
| 2524 We want to log the dates and amount of time spent working on issues, and be | |
| 2525 able to give a summary of the total time spent on a particular issue. | |
| 2526 | |
| 2527 1. Add a new class to your tracker ``dbinit.py``:: | |
| 2528 | |
| 2529 # storage for time logging | |
| 2530 timelog = Class(db, "timelog", period=Interval()) | |
| 2531 | |
| 2532 Note that we automatically get the date of the time log entry creation | |
| 2533 through the standard property "creation". | |
| 2534 | |
| 2535 2. Link to the new class from your issue class (again, in ``dbinit.py``):: | |
| 2536 | |
| 2537 issue = IssueClass(db, "issue", | |
| 2538 assignedto=Link("user"), topic=Multilink("keyword"), | |
| 2539 priority=Link("priority"), status=Link("status"), | |
| 2540 times=Multilink("timelog")) | |
| 2541 | |
| 2542 the "times" property is the new link to the "timelog" class. | |
| 2543 | |
| 2544 3. We'll need to let people add in times to the issue, so in the web interface | |
| 2545 we'll have a new entry field, just below the change note box:: | |
| 2546 | |
| 2547 <tr> | |
| 2548 <th nowrap>Time Log</th> | |
| 2549 <td colspan=3><input name=":timelog"> | |
| 2550 (enter as "3y 1m 4d 2:40:02" or parts thereof) | |
| 2551 </td> | |
| 2552 </tr> | |
| 2553 | |
| 2554 Note that we've made up a new form variable, but since we place a colon ":" | |
| 2555 in front of it, it won't clash with any existing property variables. The | |
| 2556 names you *can't* use are ``:note``, ``:file``, ``:action``, ``:required`` | |
| 2557 and ``:template``. These variables are described in the section | |
| 2558 `performing actions in web requests`_. | |
| 2559 | |
| 2560 4. We also need to handle this new field in the CGI interface - the way to | |
| 2561 do this is through implementing a new form action (see `Setting up a | |
| 2562 "wizard" (or "druid") for controlled adding of issues`_ for another example | |
| 2563 where we implemented a new CGI form action). | |
| 2564 | |
| 2565 In this case, we'll want our action to: | |
| 2566 | |
| 2567 1. create a new "timelog" entry, | |
| 2568 2. fake that the issue's "times" property has been edited, and then | |
| 2569 3. call the normal CGI edit action handler. | |
| 2570 | |
| 2571 The code to do this is:: | |
| 2572 | |
|
1406
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2573 class Client(client.Client): |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2574 ''' derives basic CGI implementation from the standard module, |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2575 with any specific extensions |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2576 ''' |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2577 actions = client.Client.actions + ( |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2578 ('edit_with_timelog', 'timelogEditAction'), |
|
1409
8dc60d87ab42
Fixed a backlog of bug reports, and worked on python 2.3 compatibility:
Richard Jones <richard@users.sourceforge.net>
parents:
1406
diff
changeset
|
2579 ('new_with_timelog', 'timelogEditAction'), |
|
1406
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2580 ) |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2581 |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2582 def timelogEditAction(self): |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2583 ''' Handle the creation of a new time log entry if necessary. |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2584 |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2585 If we create a new entry, fake up a CGI form value for the |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2586 altered "times" property of the issue being edited. |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2587 |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2588 Punt to the regular edit action when we're done. |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2589 ''' |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2590 # if there's a timelog value specified, create an entry |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2591 if self.form.has_key(':timelog') and \ |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2592 self.form[':timelog'].value.strip(): |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2593 period = Interval(self.form[':timelog'].value) |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2594 # create it |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2595 newid = self.db.timelog.create(period=period) |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2596 |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2597 # if we're editing an existing item, get the old timelog value |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2598 if self.nodeid: |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2599 l = self.db.issue.get(self.nodeid, 'times') |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2600 l.append(newid) |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2601 else: |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2602 l = [newid] |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2603 |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2604 # now make the fake CGI form values |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2605 for entry in l: |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2606 self.form.list.append(MiniFieldStorage('times', entry)) |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2607 |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2608 # punt to the normal edit action |
|
1409
8dc60d87ab42
Fixed a backlog of bug reports, and worked on python 2.3 compatibility:
Richard Jones <richard@users.sourceforge.net>
parents:
1406
diff
changeset
|
2609 if self.nodeid: |
|
8dc60d87ab42
Fixed a backlog of bug reports, and worked on python 2.3 compatibility:
Richard Jones <richard@users.sourceforge.net>
parents:
1406
diff
changeset
|
2610 return self.editItemAction() |
|
8dc60d87ab42
Fixed a backlog of bug reports, and worked on python 2.3 compatibility:
Richard Jones <richard@users.sourceforge.net>
parents:
1406
diff
changeset
|
2611 else: |
|
8dc60d87ab42
Fixed a backlog of bug reports, and worked on python 2.3 compatibility:
Richard Jones <richard@users.sourceforge.net>
parents:
1406
diff
changeset
|
2612 return self.newItemAction() |
|
1406
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2613 |
| 1262 | 2614 you add this code to your Client class in your tracker's ``interfaces.py`` |
|
1406
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2615 file. Locate the section that looks like:: |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2616 |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2617 class Client: |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2618 ''' derives basic CGI implementation from the standard module, |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2619 with any specific extensions |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2620 ''' |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2621 pass |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2622 |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2623 and insert this code in place of the ``pass`` statement. |
| 1262 | 2624 |
| 2625 5. You'll also need to modify your ``issue.item`` form submit action so it | |
|
1406
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2626 calls the time logging action we just created. The current template will |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2627 look like this:: |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2628 |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2629 <tr> |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2630 <td> </td> |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2631 <td colspan=3 tal:content="structure context/submit"> |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2632 submit button will go here |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2633 </td> |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2634 </tr> |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2635 |
|
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2636 replace it with this:: |
| 1262 | 2637 |
| 2638 <tr> | |
| 2639 <td> </td> | |
| 2640 <td colspan=3> | |
| 2641 <tal:block tal:condition="context/id"> | |
| 2642 <input type="hidden" name=":action" value="edit_with_timelog"> | |
| 2643 <input type="submit" name="submit" value="Submit Changes"> | |
| 2644 </tal:block> | |
| 2645 <tal:block tal:condition="not:context/id"> | |
|
1409
8dc60d87ab42
Fixed a backlog of bug reports, and worked on python 2.3 compatibility:
Richard Jones <richard@users.sourceforge.net>
parents:
1406
diff
changeset
|
2646 <input type="hidden" name=":action" value="new_with_timelog"> |
| 1262 | 2647 <input type="submit" name="submit" value="Submit New Issue"> |
| 2648 </tal:block> | |
| 2649 </td> | |
| 2650 </tr> | |
| 2651 | |
|
1406
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2652 The important change is setting the action to "edit_with_timelog" for |
|
1409
8dc60d87ab42
Fixed a backlog of bug reports, and worked on python 2.3 compatibility:
Richard Jones <richard@users.sourceforge.net>
parents:
1406
diff
changeset
|
2653 edit operations (where the item exists) and "new_with_timelog" for |
|
8dc60d87ab42
Fixed a backlog of bug reports, and worked on python 2.3 compatibility:
Richard Jones <richard@users.sourceforge.net>
parents:
1406
diff
changeset
|
2654 creations operations. |
| 1262 | 2655 |
|
1270
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2656 6. We want to display a total of the time log times that have been accumulated |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2657 for an issue. To do this, we'll need to actually write some Python code, |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2658 since it's beyond the scope of PageTemplates to perform such calculations. |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2659 We do this by adding a method to the TemplatingUtils class in our tracker |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2660 ``interfaces.py`` module:: |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2661 |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2662 class TemplatingUtils: |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2663 ''' Methods implemented on this class will be available to HTML |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2664 templates through the 'utils' variable. |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2665 ''' |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2666 def totalTimeSpent(self, times): |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2667 ''' Call me with a list of timelog items (which have an Interval |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2668 "period" property) |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2669 ''' |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2670 total = Interval('') |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2671 for time in times: |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2672 total += time.period._value |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2673 return total |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2674 |
|
1406
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2675 Replace the ``pass`` line as we did in step 4 above with the Client class. |
|
1270
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2676 As indicated in the docstrings, we will be able to access the |
|
1406
ca7dfc8bce15
fixes to time tracking customisation
Richard Jones <richard@users.sourceforge.net>
parents:
1374
diff
changeset
|
2677 ``totalTimeSpent`` method via the ``utils`` variable in our templates. |
|
1270
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2678 |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2679 7. Display the time log for an issue:: |
| 1262 | 2680 |
| 2681 <table class="otherinfo" tal:condition="context/times"> | |
|
1270
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2682 <tr><th colspan="3" class="header">Time Log |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2683 <tal:block tal:replace="python:utils.totalTimeSpent(context.times)" /> |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2684 </th></tr> |
| 1262 | 2685 <tr><th>Date</th><th>Period</th><th>Logged By</th></tr> |
| 2686 <tr tal:repeat="time context/times"> | |
| 2687 <td tal:content="time/creation"></td> | |
| 2688 <td tal:content="time/period"></td> | |
| 2689 <td tal:content="time/creator"></td> | |
| 2690 </tr> | |
| 2691 </table> | |
| 2692 | |
|
1270
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2693 I put this just above the Messages log in my issue display. Note our use |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2694 of the ``totalTimeSpent`` method which will total up the times for the |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2695 issue and return a new Interval. That will be automatically displayed in |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2696 the template as text like "+ 1y 2:40" (1 year, 2 hours and 40 minutes). |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2697 |
|
c3424abf7f77
added ability to implement new templating utility methods
Richard Jones <richard@users.sourceforge.net>
parents:
1262
diff
changeset
|
2698 8. If you're using a persistent web server - roundup-server or mod_python for |
| 1262 | 2699 example - then you'll need to restart that to pick up the code changes. |
| 2700 When that's done, you'll be able to use the new time logging interface. | |
| 2701 | |
|
1292
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2702 Using a UN*X passwd file as the user database |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2703 --------------------------------------------- |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2704 |
|
1299
b2d04ce03802
Email improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
1293
diff
changeset
|
2705 On some systems the primary store of users is the UN*X passwd file. It holds |
|
1292
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2706 information on users such as their username, real name, password and primary |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2707 user group. |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2708 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2709 Roundup can use this store as its primary source of user information, but it |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2710 needs additional information too - email address(es), roundup Roles, vacation |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2711 flags, roundup hyperdb item ids, etc. Also, "retired" users must still exist |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2712 in the user database, unlike some passwd files in which the users are removed |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2713 when they no longer have access to a system. |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2714 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2715 To make use of the passwd file, we therefore synchronise between the two user |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2716 stores. We also use the passwd file to validate the user logins, as described |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2717 in the previous example, `using an external password validation source`_. We |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2718 keep the users lists in sync using a fairly simple script that runs once a |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2719 day, or several times an hour if more immediate access is needed. In short, it: |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2720 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2721 1. parses the passwd file, finding usernames, passwords and real names, |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2722 2. compares that list to the current roundup user list: |
|
1299
b2d04ce03802
Email improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
1293
diff
changeset
|
2723 |
|
1292
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2724 a. entries no longer in the passwd file are *retired* |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2725 b. entries with mismatching real names are *updated* |
| 1293 | 2726 c. entries only exist in the passwd file are *created* |
|
1299
b2d04ce03802
Email improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
1293
diff
changeset
|
2727 |
|
1292
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2728 3. send an email to administrators to let them know what's been done. |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2729 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2730 The retiring and updating are simple operations, requiring only a call to |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2731 ``retire()`` or ``set()``. The creation operation requires more information |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2732 though - the user's email address and their roundup Roles. We're going to |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2733 assume that the user's email address is the same as their login name, so we |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2734 just append the domain name to that. The Roles are determined using the |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2735 passwd group identifier - mapping their UN*X group to an appropriate set of |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2736 Roles. |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2737 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2738 The script to perform all this, broken up into its main components, is as |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2739 follows. Firstly, we import the necessary modules and open the tracker we're |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2740 to work on:: |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2741 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2742 import sys, os, smtplib |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2743 from roundup import instance, date |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2744 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2745 # open the tracker |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2746 tracker_home = sys.argv[1] |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2747 tracker = instance.open(tracker_home) |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2748 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2749 Next we read in the *passwd* file from the tracker home:: |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2750 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2751 # read in the users |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2752 file = os.path.join(tracker_home, 'users.passwd') |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2753 users = [x.strip().split(':') for x in open(file).readlines()] |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2754 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2755 Handle special users (those to ignore in the file, and those who don't appear |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2756 in the file):: |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2757 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2758 # users to not keep ever, pre-load with the users I know aren't |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2759 # "real" users |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2760 ignore = ['ekmmon', 'bfast', 'csrmail'] |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2761 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2762 # users to keep - pre-load with the roundup-specific users |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2763 keep = ['comment_pool', 'network_pool', 'admin', 'dev-team', 'cs_pool', |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2764 'anonymous', 'system_pool', 'automated'] |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2765 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2766 Now we map the UN*X group numbers to the Roles that users should have:: |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2767 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2768 roles = { |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2769 '501': 'User,Tech', # tech |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2770 '502': 'User', # finance |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2771 '503': 'User,CSR', # customer service reps |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2772 '504': 'User', # sales |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2773 '505': 'User', # marketing |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2774 } |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2775 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2776 Now we do all the work. Note that the body of the script (where we have the |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2777 tracker database open) is wrapped in a ``try`` / ``finally`` clause, so that |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2778 we always close the database cleanly when we're finished. So, we now do all |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2779 the work:: |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2780 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2781 # open the database |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2782 db = tracker.open('admin') |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2783 try: |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2784 # store away messages to send to the tracker admins |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2785 msg = [] |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2786 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2787 # loop over the users list read in from the passwd file |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2788 for user,passw,uid,gid,real,home,shell in users: |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2789 if user in ignore: |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2790 # this user shouldn't appear in our tracker |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2791 continue |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2792 keep.append(user) |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2793 try: |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2794 # see if the user exists in the tracker |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2795 uid = db.user.lookup(user) |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2796 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2797 # yes, they do - now check the real name for correctness |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2798 if real != db.user.get(uid, 'realname'): |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2799 db.user.set(uid, realname=real) |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2800 msg.append('FIX %s - %s'%(user, real)) |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2801 except KeyError: |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2802 # nope, the user doesn't exist |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2803 db.user.create(username=user, realname=real, |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2804 address='%s@ekit-inc.com'%user, roles=roles[gid]) |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2805 msg.append('ADD %s - %s (%s)'%(user, real, roles[gid])) |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2806 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2807 # now check that all the users in the tracker are also in our "keep" |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2808 # list - retire those who aren't |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2809 for uid in db.user.list(): |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2810 user = db.user.get(uid, 'username') |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2811 if user not in keep: |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2812 db.user.retire(uid) |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2813 msg.append('RET %s'%user) |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2814 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2815 # if we did work, then send email to the tracker admins |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2816 if msg: |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2817 # create the email |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2818 msg = '''Subject: %s user database maintenance |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2819 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2820 %s |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2821 '''%(db.config.TRACKER_NAME, '\n'.join(msg)) |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2822 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2823 # send the email |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2824 smtp = smtplib.SMTP(db.config.MAILHOST) |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2825 addr = db.config.ADMIN_EMAIL |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2826 smtp.sendmail(addr, addr, msg) |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2827 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2828 # now we're done - commit the changes |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2829 db.commit() |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2830 finally: |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2831 # always close the database cleanly |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2832 db.close() |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2833 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2834 And that's it! |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2835 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2836 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2837 Enabling display of either message summaries or the entire messages |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2838 ------------------------------------------------------------------- |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2839 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2840 This is pretty simple - all we need to do is copy the code from the example |
|
1304
61ad556cfc8d
working toward 0.5.2 release
Richard Jones <richard@users.sourceforge.net>
parents:
1299
diff
changeset
|
2841 `displaying only message summaries in the issue display`_ into our template |
|
1292
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2842 alongside the summary display, and then introduce a switch that shows either |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2843 one or the other. We'll use a new form variable, ``:whole_messages`` to |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2844 achieve this:: |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2845 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2846 <table class="messages" tal:condition="context/messages"> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2847 <tal:block tal:condition="not:request/form/:whole_messages/value | python:0"> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2848 <tr><th colspan=3 class="header">Messages</th> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2849 <th colspan=2 class="header"> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2850 <a href="?:whole_messages=yes">show entire messages</a> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2851 </th> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2852 </tr> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2853 <tr tal:repeat="msg context/messages"> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2854 <td><a tal:attributes="href string:msg${msg/id}" |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2855 tal:content="string:msg${msg/id}"></a></td> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2856 <td tal:content="msg/author">author</td> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2857 <td nowrap tal:content="msg/date/pretty">date</td> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2858 <td tal:content="msg/summary">summary</td> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2859 <td> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2860 <a tal:attributes="href string:?:remove:messages=${msg/id}&:action=edit">remove</a> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2861 </td> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2862 </tr> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2863 </tal:block> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2864 |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2865 <tal:block tal:condition="request/form/:whole_messages/value | python:0"> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2866 <tr><th colspan=2 class="header">Messages</th> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2867 <th class="header"><a href="?:whole_messages=">show only summaries</a></th> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2868 </tr> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2869 <tal:block tal:repeat="msg context/messages"> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2870 <tr> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2871 <th tal:content="msg/author">author</th> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2872 <th nowrap tal:content="msg/date/pretty">date</th> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2873 <th style="text-align: right"> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2874 (<a tal:attributes="href string:?:remove:messages=${msg/id}&:action=edit">remove</a>) |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2875 </th> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2876 </tr> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2877 <tr><td colspan=3 tal:content="msg/content"></td></tr> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2878 </tal:block> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2879 </tal:block> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2880 </table> |
|
f7d9fefcae88
Fixes for SourceForge tracker bugs.
Richard Jones <richard@users.sourceforge.net>
parents:
1278
diff
changeset
|
2881 |
| 1262 | 2882 |
| 1098 | 2883 ------------------- |
|
659
e429649ed124
More documentation cleanups.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2884 |
|
686
c52122f38c9b
Documentation cleanup, added info for potential (and current) developers
Richard Jones <richard@users.sourceforge.net>
parents:
684
diff
changeset
|
2885 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
|
2886 |
|
c52122f38c9b
Documentation cleanup, added info for potential (and current) developers
Richard Jones <richard@users.sourceforge.net>
parents:
684
diff
changeset
|
2887 .. _`Table of Contents`: index.html |
|
1244
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2888 .. _`design documentation`: design.html |
|
8dd4f736370b
merge from maintenance branch
Richard Jones <richard@users.sourceforge.net>
parents:
1236
diff
changeset
|
2889 |
