|
1 | | -# $Id: cgi_client.py,v 1.11 2001-07-30 06:17:45 richard Exp $ |
| 1 | +# $Id: cgi_client.py,v 1.12 2001-07-30 06:26:31 richard Exp $ |
2 | 2 |
|
3 | 3 | import os, cgi, pprint, StringIO, urlparse, re, traceback |
4 | 4 |
|
@@ -167,7 +167,7 @@ def list(self, sort=None, group=None, filter=None, columns=None, |
167 | 167 | filter, columns, sort, group) |
168 | 168 | self.pagefoot() |
169 | 169 |
|
170 | | - def showitem(self, message=None): |
| 170 | + def shownode(self, message=None): |
171 | 171 | ''' display an item |
172 | 172 | ''' |
173 | 173 | cn = self.classname |
@@ -309,11 +309,30 @@ def showitem(self, message=None): |
309 | 309 | # use the template to display the item |
310 | 310 | htmltemplate.item(self, self.TEMPLATES, self.db, self.classname, nodeid) |
311 | 311 | self.pagefoot() |
312 | | - showissue = showitem |
313 | | - showmsg = showitem |
314 | | - |
315 | | - def newissue(self, message=None): |
316 | | - ''' add an issue |
| 312 | + showissue = shownode |
| 313 | + showmsg = shownode |
| 314 | + |
| 315 | + def newnode(self, message=None): |
| 316 | + ''' Add a new node to the database. |
| 317 | + |
| 318 | + The form works in two modes: blank form and submission (that is, |
| 319 | + the submission goes to the same URL). **Eventually this means that |
| 320 | + the form will have previously entered information in it if |
| 321 | + submission fails. |
| 322 | +
|
| 323 | + The new node will be created with the properties specified in the |
| 324 | + form submission. For multilinks, multiple form entries are handled, |
| 325 | + as are prop=value,value,value. You can't mix them though. |
| 326 | +
|
| 327 | + If the new node is to be referenced from somewhere else immediately |
| 328 | + (ie. the new node is a file that is to be attached to a support |
| 329 | + issue) then supply one of these arguments in addition to the usual |
| 330 | + form entries: |
| 331 | + :link=designator:property |
| 332 | + :multilink=designator:property |
| 333 | + ... which means that once the new node is created, the "property" |
| 334 | + on the node given by "designator" should now reference the new |
| 335 | + node's id. The node id will be appended to the multilink. |
317 | 336 | ''' |
318 | 337 | cn = self.classname |
319 | 338 | cl = self.db.classes[cn] |
@@ -454,13 +473,14 @@ def newissue(self, message=None): |
454 | 473 | htmltemplate.newitem(self, self.TEMPLATES, self.db, self.classname, |
455 | 474 | self.form) |
456 | 475 | self.pagefoot() |
457 | | - newuser = newissue |
| 476 | + newissue = newnode |
| 477 | + newuser = newnode |
458 | 478 |
|
459 | 479 | def showuser(self, message=None): |
460 | 480 | ''' display an item |
461 | 481 | ''' |
462 | 482 | if self.user in ('admin', self.db.user.get(self.nodeid, 'username')): |
463 | | - self.showitem(message) |
| 483 | + self.shownode(message) |
464 | 484 | else: |
465 | 485 | raise Unauthorised |
466 | 486 |
|
@@ -525,6 +545,15 @@ def __del__(self): |
525 | 545 |
|
526 | 546 | # |
527 | 547 | # $Log: not supported by cvs2svn $ |
| 548 | +# Revision 1.11 2001/07/30 06:17:45 richard |
| 549 | +# Features: |
| 550 | +# . Added ability for cgi newblah forms to indicate that the new node |
| 551 | +# should be linked somewhere. |
| 552 | +# Fixed: |
| 553 | +# . Fixed the agument handling for the roundup-admin find command. |
| 554 | +# . Fixed handling of summary when no note supplied for newblah. Again. |
| 555 | +# . Fixed detection of no form in htmltemplate Field display. |
| 556 | +# |
528 | 557 | # Revision 1.10 2001/07/30 02:37:34 richard |
529 | 558 | # Temporary measure until we have decent schema migration... |
530 | 559 | # |
|
0 commit comments