Mercurial > p > roundup > code
diff roundup/cgi_client.py @ 128:ce36f2962b94
Fixed handling of passed-in values in form elements (ie. during a drill-down)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Sun, 29 Jul 2001 08:27:40 +0000 |
| parents | 0791d13baea7 |
| children | 664faa54d672 |
line wrap: on
line diff
--- a/roundup/cgi_client.py Sun Jul 29 07:01:39 2001 +0000 +++ b/roundup/cgi_client.py Sun Jul 29 08:27:40 2001 +0000 @@ -1,4 +1,4 @@ -# $Id: cgi_client.py,v 1.7 2001-07-29 07:01:39 richard Exp $ +# $Id: cgi_client.py,v 1.8 2001-07-29 08:27:40 richard Exp $ import os, cgi, pprint, StringIO, urlparse, re, traceback @@ -105,22 +105,29 @@ def index_filterspec(self): ''' pull the index filter spec from the form + + Links and multilinks want to be lists - the rest are straight + strings. ''' - # all the other form args are filters + props = self.db.classes[self.classname].getprops() + # all the form args not starting with ':' are filters filterspec = {} for key in self.form.keys(): if key[0] == ':': continue + prop = props[key] value = self.form[key] - if type(value) == type([]): - value = [arg.value for arg in value] + if prop.isLinkType or prop.isMultilinkType: + if type(value) == type([]): + value = [arg.value for arg in value] + else: + value = value.value.split(',') + l = filterspec.get(key, []) + l = l + value + filterspec[key] = l else: - value = value.value.split(',') - l = filterspec.get(key, []) - l = l + value - filterspec[key] = l + filterspec[key] = value.value return filterspec - default_index_sort = ['-activity'] default_index_group = ['priority'] default_index_filter = [] @@ -496,6 +503,9 @@ # # $Log: not supported by cvs2svn $ +# Revision 1.7 2001/07/29 07:01:39 richard +# Added vim command to all source so that we don't get no steenkin' tabs :) +# # Revision 1.6 2001/07/29 04:04:00 richard # Moved some code around allowing for subclassing to change behaviour. #
