Mercurial > p > roundup > code
diff roundup/cgi_client.py @ 767:cbbc987a390d
Allow form to set user-properties on a Fileclass.
Don't assume that a Fileclass is named "files".
| author | Gordon B. McMillan <gmcm@users.sourceforge.net> |
|---|---|
| date | Wed, 12 Jun 2002 21:28:25 +0000 |
| parents | e13b9ba46d9d |
| children | c2c9f9f64a45 |
line wrap: on
line diff
--- a/roundup/cgi_client.py Wed Jun 12 01:46:23 2002 +0000 +++ b/roundup/cgi_client.py Wed Jun 12 21:28:25 2002 +0000 @@ -15,7 +15,7 @@ # 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). @@ -833,6 +833,7 @@ ''' cn = self.classname cl = self.db.classes[cn] + props = parsePropsFromForm(self.db, cl, self.form) # possibly perform a create keys = self.form.keys() @@ -843,8 +844,10 @@ 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 @@ -925,7 +928,7 @@ ''' 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' @@ -1363,6 +1366,9 @@ # # $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.
