summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 27550c0)
raw | patch | inline | side by side (parent: 27550c0)
author | gmcm <gmcm@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 12 Jun 2002 21:28:25 +0000 (21:28 +0000) | ||
committer | gmcm <gmcm@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 12 Jun 2002 21:28:25 +0000 (21:28 +0000) |
Don't assume that a Fileclass is named "files".
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@780 57a73879-2fb5-44c3-a270-3262357dd7e2
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@780 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 51ba6222d0df44ad415d41c948e13dfa3f146839..081f7e8dc6ec30db957b408c2f32dbd7d37e0c4e 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.127 2002-06-11 06:38:24 richard Exp $
+# $Id: cgi_client.py,v 1.128 2002-06-12 21:28:25 gmcm Exp $
__doc__ = """
WWW request handler (also used in the stand-alone server).
'''
cn = self.classname
cl = self.db.classes[cn]
+ props = parsePropsFromForm(self.db, cl, self.form)
# possibly perform a create
keys = self.form.keys()
if not mime_type:
mime_type = "application/octet-stream"
# save the file
- nid = cl.create(content=file.file.read(), type=mime_type,
- name=file.filename)
+ props['type'] = mime_type
+ props['name'] = file.filename
+ props['content'] = file.file.read()
+ nid = cl.create(**props)
# handle linked nodes
self._post_editnode(nid)
# and some nice feedback for the user
''' display a file
'''
nodeid = self.nodeid
- cl = self.db.file
+ cl = self.db.classes[self.classname]
mime_type = cl.get(nodeid, 'type')
if mime_type == 'message/rfc822':
mime_type = 'text/plain'
#
# $Log: not supported by cvs2svn $
+# Revision 1.127 2002/06/11 06:38:24 richard
+# . #565996 ] The "Attach a File to this Issue" fails
+#
# Revision 1.126 2002/05/29 01:16:17 richard
# Sorry about this huge checkin! It's fixing a lot of related stuff in one go
# though.