summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a476e0b)
raw | patch | inline | side by side (parent: a476e0b)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 16 Oct 2001 03:36:21 +0000 (03:36 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 16 Oct 2001 03:36:21 +0000 (03:36 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@303 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
roundup/cgi_client.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index e39542a7a6ff6ddd6a97135fe4904f32cbcfa30f..e8eeecaf5d91dfc5ff2f6fdccf6f0e12ac4aa327 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
2001-10-?? - 0.3.0
Fixed:
. Stand-alone server now has a configurable setuid user.
-
+ . CGI interface wasn't handling checkboxes at all.
2001-10-11 - 0.3.0 pre 2
Fixed:
diff --git a/roundup/cgi_client.py b/roundup/cgi_client.py
index 223a7866786463644fad08664cfef9d1639494e9..1fcc3fad9efbe9b16641786868c051b6617e15b4 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.31 2001-10-14 10:55:00 richard Exp $
+# $Id: cgi_client.py,v 1.32 2001-10-16 03:36:21 richard Exp $
import os, cgi, pprint, StringIO, urlparse, re, traceback, mimetypes
import base64, Cookie, time
num_re = re.compile('^\d+$')
if keys:
try:
- props, changed = parsePropsFromForm(cl, self.form, self.nodeid)
+ props, changed = parsePropsFromForm(self.db, cl, self.form,
+ self.nodeid)
cl.set(self.nodeid, **props)
self._post_editnode(self.nodeid, changed)
# and some nice feedback for the user
''' create a node based on the contents of the form
'''
cl = self.db.classes[self.classname]
- props, dummy = parsePropsFromForm(cl, self.form)
+ props, dummy = parsePropsFromForm(self.db, cl, self.form)
return cl.create(**props)
def _post_editnode(self, nid, changes=None):
'''
# TODO: pre-check the required fields and username key property
cl = self.db.classes['user']
- props, dummy = parsePropsFromForm(cl, self.form)
+ props, dummy = parsePropsFromForm(self.db, cl, self.form)
uid = cl.create(**props)
self.user = self.db.user.get(uid, 'username')
password = self.db.user.get(uid, 'password')
'''%(title, style, message, title, user_name, add_links, admin_links,
user_info))
-def parsePropsFromForm(cl, form, nodeid=0):
+def parsePropsFromForm(db, cl, form, nodeid=0):
'''Pull properties for the given class out of the form.
'''
props = {}
link = cl.properties[key].classname
if not num_re.match(value):
try:
- value = self.db.classes[link].lookup(value)
- except:
+ value = db.classes[link].lookup(value)
+ except KeyError:
raise ValueError, 'property "%s": %s not a %s'%(
key, value, link)
elif isinstance(proptype, hyperdb.Multilink):
for entry in map(str, value):
if not num_re.match(entry):
try:
- entry = self.db.classes[link].lookup(entry)
- except:
+ entry = db.classes[link].lookup(entry)
+ except KeyError:
raise ValueError, \
- 'property "%s": %s not a %s'%(key,
- entry, link)
+ 'property "%s": "%s" not an entry of %s'%(key,
+ entry, link.capitalize())
l.append(entry)
l.sort()
value = l
#
# $Log: not supported by cvs2svn $
+# Revision 1.31 2001/10/14 10:55:00 richard
+# Handle empty strings in HTML template Link function
+#
# Revision 1.30 2001/10/09 07:38:58 richard
# Pushed the base code for the extended schema CGI interface back into the
# code cgi_client module so that future updates will be less painful.