Skip to content

Commit 4104911

Browse files
author
Richard Jones
committed
Added some documentation on how the newblah works.
1 parent 925a1b8 commit 4104911

File tree

1 file changed

+38
-9
lines changed

1 file changed

+38
-9
lines changed

roundup/cgi_client.py

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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 $
22

33
import os, cgi, pprint, StringIO, urlparse, re, traceback
44

@@ -167,7 +167,7 @@ def list(self, sort=None, group=None, filter=None, columns=None,
167167
filter, columns, sort, group)
168168
self.pagefoot()
169169

170-
def showitem(self, message=None):
170+
def shownode(self, message=None):
171171
''' display an item
172172
'''
173173
cn = self.classname
@@ -309,11 +309,30 @@ def showitem(self, message=None):
309309
# use the template to display the item
310310
htmltemplate.item(self, self.TEMPLATES, self.db, self.classname, nodeid)
311311
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.
317336
'''
318337
cn = self.classname
319338
cl = self.db.classes[cn]
@@ -454,13 +473,14 @@ def newissue(self, message=None):
454473
htmltemplate.newitem(self, self.TEMPLATES, self.db, self.classname,
455474
self.form)
456475
self.pagefoot()
457-
newuser = newissue
476+
newissue = newnode
477+
newuser = newnode
458478

459479
def showuser(self, message=None):
460480
''' display an item
461481
'''
462482
if self.user in ('admin', self.db.user.get(self.nodeid, 'username')):
463-
self.showitem(message)
483+
self.shownode(message)
464484
else:
465485
raise Unauthorised
466486

@@ -525,6 +545,15 @@ def __del__(self):
525545

526546
#
527547
# $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+
#
528557
# Revision 1.10 2001/07/30 02:37:34 richard
529558
# Temporary measure until we have decent schema migration...
530559
#

0 commit comments

Comments
 (0)