summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f41124b)
raw | patch | inline | side by side (parent: f41124b)
author | gmcm <gmcm@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 27 Jun 2002 12:01:53 +0000 (12:01 +0000) | ||
committer | gmcm <gmcm@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 27 Jun 2002 12:01:53 +0000 (12:01 +0000) |
Some minor optimizations (only compile regexes once).
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@819 57a73879-2fb5-44c3-a270-3262357dd7e2
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@819 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/cgi_client.py | patch | blob | history |
diff --git a/roundup/cgi_client.py b/roundup/cgi_client.py
index 926556fa8ff81e6049885477a3b8d9cf832d19de..e4e01dadb283185992fc9c409ab4f167e372aa08 100644 (file)
--- a/roundup/cgi_client.py
+++ b/roundup/cgi_client.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: cgi_client.py,v 1.129 2002-06-20 23:52:11 richard Exp $
+# $Id: cgi_client.py,v 1.130 2002-06-27 12:01:53 gmcm Exp $
__doc__ = """
WWW request handler (also used in the stand-alone server).
w('</tr>')
w('</table>')
- def shownode(self, message=None):
+ def shownode(self, message=None, num_re=re.compile('^\d+$')):
''' display an item
'''
cn = self.classname
cl = self.db.classes[cn]
+ if self.form.has_key(':multilink'):
+ link = self.form[':multilink'].value
+ designator, linkprop = link.split(':')
+ xtra = ' for <a href="%s">%s</a>' % (designator, designator)
+ else:
+ xtra = ''
# possibly perform an edit
keys = self.form.keys()
- num_re = re.compile('^\d+$')
# don't try to set properties if the user has just logged in
if keys and not self.form.has_key('__login_name'):
try:
id = self.nodeid
if cl.getkey():
id = cl.get(id, cl.getkey())
- self.pagehead('%s: %s'%(self.classname.capitalize(), id), message)
+ self.pagehead('%s: %s %s'%(self.classname.capitalize(), id, xtra), message)
nodeid = self.nodeid
'''
cn = self.classname
cl = self.db.classes[cn]
+ if self.form.has_key(':multilink'):
+ link = self.form[':multilink'].value
+ designator, linkprop = link.split(':')
+ xtra = ' for <a href="%s">%s</a>' % (designator, designator)
+ else:
+ xtra = ''
# possibly perform a create
keys = self.form.keys()
s = StringIO.StringIO()
traceback.print_exc(None, s)
message = '<pre>%s</pre>'%cgi.escape(s.getvalue())
- self.pagehead(_('New %(classname)s')%{'classname':
- self.classname.capitalize()}, message)
+ self.pagehead(_('New %(classname)s %(xtra)s')%{
+ 'classname': self.classname.capitalize(),
+ 'xtra': xtra }, message)
# call the template
newitem = htmltemplate.NewItemTemplate(self, self.instance.TEMPLATES,
cn = self.classname
cl = self.db.classes[cn]
props = parsePropsFromForm(self.db, cl, self.form)
+ if self.form.has_key(':multilink'):
+ link = self.form[':multilink'].value
+ designator, linkprop = link.split(':')
+ xtra = ' for <a href="%s">%s</a>' % (designator, designator)
+ else:
+ xtra = ''
# possibly perform a create
keys = self.form.keys()
traceback.print_exc(None, s)
message = '<pre>%s</pre>'%cgi.escape(s.getvalue())
- self.pagehead(_('New %(classname)s')%{'classname':
- self.classname.capitalize()}, message)
+ self.pagehead(_('New %(classname)s %(xtra)s')%{
+ 'classname': self.classname.capitalize(),
+ 'xtra': xtra }, message)
newitem = htmltemplate.NewItemTemplate(self, self.instance.TEMPLATES,
self.classname)
newitem.render(self.form)
self.pagefoot()
- def showuser(self, message=None):
+ def showuser(self, message=None, num_re=re.compile('^\d+$')):
'''Display a user page for editing. Make sure the user is allowed
to edit this node, and also check for password changes.
'''
# perform any editing
#
keys = self.form.keys()
- num_re = re.compile('^\d+$')
if keys:
try:
props = parsePropsFromForm(self.db, user, self.form,
default_index_columns = ['activity','status','title','assignedto']
default_index_filterspec = {'status': ['1', '2', '3', '4', '5', '6', '7']}
-def parsePropsFromForm(db, cl, form, nodeid=0):
+def parsePropsFromForm(db, cl, form, nodeid=0, num_re=re.compile('^\d+$')):
'''Pull properties for the given class out of the form.
'''
props = {}
keys = form.keys()
- num_re = re.compile('^\d+$')
for key in keys:
if not cl.properties.has_key(key):
continue
#
# $Log: not supported by cvs2svn $
+# Revision 1.129 2002/06/20 23:52:11 richard
+# Better handling of unauth attempt to edit stuff
+#
# Revision 1.128 2002/06/12 21:28:25 gmcm
# Allow form to set user-properties on a Fileclass.
# Don't assume that a Fileclass is named "files".