summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a25e89b)
raw | patch | inline | side by side (parent: a25e89b)
author | rochecompaan <rochecompaan@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 20 Dec 2001 06:13:24 +0000 (06:13 +0000) | ||
committer | rochecompaan <rochecompaan@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 20 Dec 2001 06:13:24 +0000 (06:13 +0000) |
. Exception handling in hyperdb for strings-that-look-like numbers got
lost somewhere
. Internet Explorer submits full path for filename - we now strip away
the path
Features added:
. Link and multilink properties are now displayed sorted in the cgi
interface
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@478 57a73879-2fb5-44c3-a270-3262357dd7e2
lost somewhere
. Internet Explorer submits full path for filename - we now strip away
the path
Features added:
. Link and multilink properties are now displayed sorted in the cgi
interface
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@478 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/cgi_client.py | patch | blob | history | |
roundup/htmltemplate.py | patch | blob | history | |
roundup/hyperdb.py | patch | blob | history |
diff --git a/roundup/cgi_client.py b/roundup/cgi_client.py
index e3dee1c27162ba6f27a2113b97898003d5e66efa..c8e1fef6699c13615b57b525dfcfe7275284b6f0 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.84 2001-12-18 15:30:30 rochecompaan Exp $
+# $Id: cgi_client.py,v 1.85 2001-12-20 06:13:24 rochecompaan Exp $
__doc__ = """
WWW request handler (also used in the stand-alone server).
if self.form.has_key('__file'):
file = self.form['__file']
if file.filename:
- mime_type = mimetypes.guess_type(file.filename)[0]
+ filename = file.filename.split('\\')[-1]
+ mime_type = mimetypes.guess_type(filename)[0]
if not mime_type:
mime_type = "application/octet-stream"
# create the new file entry
files.append(self.db.file.create(type=mime_type,
- name=file.filename, content=file.file.read()))
+ name=filename, content=file.file.read()))
# we don't want to do a message if none of the following is true...
cn = self.classname
# and some nice feedback for the user
message = _('%(classname)s created ok')%{'classname': cn}
- self.db.commit()
# render the newly created issue
+ self.db.commit()
self.nodeid = nid
self.pagehead('%s: %s'%(self.classname.capitalize(), nid),
message)
self.classname)
item.render(nid)
self.pagefoot()
+ return
except:
self.db.rollback()
s = StringIO.StringIO()
traceback.print_exc(None, s)
message = '<pre>%s</pre>'%cgi.escape(s.getvalue())
- else:
- self.pagehead(_('New %(classname)s')%{'classname':
- self.classname.capitalize()}, message)
+ self.pagehead(_('New %(classname)s')%{'classname':
+ self.classname.capitalize()}, message)
- # call the template
- newitem = htmltemplate.NewItemTemplate(self, self.TEMPLATES,
- self.classname)
- newitem.render(self.form)
+ # call the template
+ newitem = htmltemplate.NewItemTemplate(self, self.TEMPLATES,
+ self.classname)
+ newitem.render(self.form)
- self.pagefoot()
+ self.pagefoot()
newissue = newnode
def newuser(self, message=None):
#
# $Log: not supported by cvs2svn $
+# Revision 1.84 2001/12/18 15:30:30 rochecompaan
+# Fixed bugs:
+# . Fixed file creation and retrieval in same transaction in anydbm
+# backend
+# . Cgi interface now renders new issue after issue creation
+# . Could not set issue status to resolved through cgi interface
+# . Mail gateway was changing status back to 'chatting' if status was
+# omitted as an argument
+#
# Revision 1.83 2001/12/15 23:51:01 richard
# Tested the changes and fixed a few problems:
# . files are now attached to the issue as well as the message
index 042e7e53ea63da840887cb9f7ba906c71390e1d6..ea2981f56a320997b38bb3e329d6e09e0598f358 100644 (file)
--- a/roundup/htmltemplate.py
+++ b/roundup/htmltemplate.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: htmltemplate.py,v 1.47 2001-11-26 22:55:56 richard Exp $
+# $Id: htmltemplate.py,v 1.48 2001-12-20 06:13:24 rochecompaan Exp $
__doc__ = """
Template engine.
if not self.nodeid and self.form is None and self.filterspec is None:
return _('[Field: not called from item]')
propclass = self.properties[property]
+ if (isinstance(propclass, hyperdb.Link) or
+ isinstance(propclass, hyperdb.Multilink)):
+ linkcl = self.db.classes[propclass.classname]
+ def sortfunc(a, b, cl=linkcl):
+ if cl.getprops().has_key('order'):
+ sort_on = 'order'
+ else:
+ sort_on = cl.labelprop()
+ r = cmp(cl.get(a, sort_on), cl.get(b, sort_on))
+ return r
if self.nodeid:
value = self.cl.get(self.nodeid, property, None)
# TODO: remove this from the code ... it's only here for
size = size or 30
s = '<input type="password" name="%s" size="%s">'%(property, size)
elif isinstance(propclass, hyperdb.Link):
- linkcl = self.db.classes[propclass.classname]
l = ['<select name="%s">'%property]
k = linkcl.labelprop()
if value is None:
else:
s = ''
l.append('<option %svalue="-1">- no selection -</option>'%s)
- for optionid in linkcl.list():
+ options = linkcl.list()
+ options.sort(sortfunc)
+ for optionid in options:
option = linkcl.get(optionid, k)
s = ''
if optionid == value:
l.append('</select>')
s = '\n'.join(l)
elif isinstance(propclass, hyperdb.Multilink):
- linkcl = self.db.classes[propclass.classname]
list = linkcl.list()
+ list.sort(sortfunc)
height = height or min(len(list), 7)
l = ['<select multiple name="%s" size="%s">'%(property, height)]
k = linkcl.labelprop()
#
# $Log: not supported by cvs2svn $
+# Revision 1.47 2001/11/26 22:55:56 richard
+# Feature:
+# . Added INSTANCE_NAME to configuration - used in web and email to identify
+# the instance.
+# . Added EMAIL_SIGNATURE_POSITION to indicate where to place the roundup
+# signature info in e-mails.
+# . Some more flexibility in the mail gateway and more error handling.
+# . Login now takes you to the page you back to the were denied access to.
+#
+# Fixed:
+# . Lots of bugs, thanks Roché and others on the devel mailing list!
+#
# Revision 1.46 2001/11/24 00:53:12 jhermann
# "except:" is bad, bad , bad!
#
diff --git a/roundup/hyperdb.py b/roundup/hyperdb.py
index 88376f27640e89d66bbf3e71633a40edd5334128..26d324aa4f8e2dd722f244f979bfa59b35c0fe3c 100644 (file)
--- a/roundup/hyperdb.py
+++ b/roundup/hyperdb.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: hyperdb.py,v 1.42 2001-12-16 10:53:37 richard Exp $
+# $Id: hyperdb.py,v 1.43 2001-12-20 06:13:24 rochecompaan Exp $
__doc__ = """
Hyperdatabase implementation, especially field types.
if (isinstance(propclass, String) or
isinstance(propclass, Date)):
# it might be a string that's really an integer
- av = int(av)
- bv = int(bv)
+ try:
+ av = int(av)
+ bv = int(bv)
+ except:
+ pass
if dir == '+':
r = cmp(av, bv)
if r != 0: return r
link = db.classes[propclass.classname]
if av is None and bv is not None: return -1
if av is not None and bv is None: return 1
- if av is None and bv is None: return 0
+ if av is None and bv is None: continue
if link.getprops().has_key('order'):
if dir == '+':
r = cmp(link.get(av, 'order'),
#
# $Log: not supported by cvs2svn $
+# Revision 1.42 2001/12/16 10:53:37 richard
+# take a copy of the node dict so that the subsequent set
+# operation doesn't modify the oldvalues structure
+#
# Revision 1.41 2001/12/15 23:47:47 richard
# Cleaned up some bare except statements
#