Mercurial > p > roundup > code
changeset 1028:16498e77e3ff
allow overiding of the index args roundup/cgi/templating.py
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 03 Sep 2002 07:33:01 +0000 |
| parents | 9990a635de03 |
| children | c3e391d9c4e9 |
| files | roundup/backends/back_anydbm.py roundup/backends/back_bsddb.py roundup/cgi/templating.py roundup/templates/classic/html/issue.index |
| diffstat | 4 files changed, 37 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/roundup/backends/back_anydbm.py Tue Sep 03 07:13:42 2002 +0000 +++ b/roundup/backends/back_anydbm.py Tue Sep 03 07:33:01 2002 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -#$Id: back_anydbm.py,v 1.68 2002-09-03 05:46:20 richard Exp $ +#$Id: back_anydbm.py,v 1.69 2002-09-03 07:33:01 richard Exp $ ''' This module defines a backend that saves the hyperdatabase in a database chosen by anydbm. It is guaranteed to always be available in python @@ -175,8 +175,8 @@ # new database? let anydbm pick the best dbm if not db_type: if __debug__: - print >>hyperdb.DEBUG, "opendb anydbm.open(%r, 'n')"%path - return anydbm.open(path, 'n') + print >>hyperdb.DEBUG, "opendb anydbm.open(%r, 'c')"%path + return anydbm.open(path, 'c') # open the database with the correct module try: @@ -1909,6 +1909,9 @@ # #$Log: not supported by cvs2svn $ +#Revision 1.68 2002/09/03 05:46:20 richard +#handle disappearing users for journaltags +# #Revision 1.67 2002/09/03 02:53:53 richard #Fixed nasty bug that was preventing changes to multilinks going through. #
--- a/roundup/backends/back_bsddb.py Tue Sep 03 07:13:42 2002 +0000 +++ b/roundup/backends/back_bsddb.py Tue Sep 03 07:33:01 2002 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -#$Id: back_bsddb.py,v 1.20 2002-07-19 03:36:34 richard Exp $ +#$Id: back_bsddb.py,v 1.21 2002-09-03 07:33:01 richard Exp $ ''' This module defines a backend that saves the hyperdatabase in BSDDB. ''' @@ -61,8 +61,8 @@ path = os.path.join(os.getcwd(), self.dir, name) if not os.path.exists(path): if __debug__: - print >>hyperdb.DEBUG, "opendb bsddb.open(%r, 'n')"%path - return bsddb.btopen(path, 'n') + print >>hyperdb.DEBUG, "opendb bsddb.open(%r, 'c')"%path + return bsddb.btopen(path, 'c') # open the database with the correct module if __debug__: @@ -131,6 +131,15 @@ # #$Log: not supported by cvs2svn $ +#Revision 1.20 2002/07/19 03:36:34 richard +#Implemented the destroy() method needed by the session database (and possibly +#others). At the same time, I removed the leading underscores from the hyperdb +#methods that Really Didn't Need Them. +#The journal also raises IndexError now for all situations where there is a +#request for the journal of a node that doesn't have one. It used to return +#[] in _some_ situations, but not all. This _may_ break code, but the tests +#pass... +# #Revision 1.19 2002/07/14 02:05:53 richard #. all storage-specific code (ie. backend) is now implemented by the backends #
--- a/roundup/cgi/templating.py Tue Sep 03 07:13:42 2002 +0000 +++ b/roundup/cgi/templating.py Tue Sep 03 07:33:01 2002 +0000 @@ -1096,28 +1096,31 @@ def indexargs_href(self, url, args): ''' embed the current index args in a URL ''' l = ['%s=%s'%(k,v) for k,v in args.items()] - if self.columns: + if self.columns and not args.has_key(':columns'): l.append(':columns=%s'%(','.join(self.columns))) - if self.sort[1] is not None: + if self.sort[1] is not None and not args.has_key(':sort'): if self.sort[0] == '-': val = '-'+self.sort[1] else: val = self.sort[1] l.append(':sort=%s'%val) - if self.group[1] is not None: + if self.group[1] is not None and not args.has_key(':group'): if self.group[0] == '-': val = '-'+self.group[1] else: val = self.group[1] l.append(':group=%s'%val) - if self.filter: + if self.filter and not args.has_key(':columns'): l.append(':filter=%s'%(','.join(self.filter))) for k,v in self.filterspec.items(): - l.append('%s=%s'%(k, ','.join(v))) - if self.search_text: + if not args.has_key(k): + l.append('%s=%s'%(k, ','.join(v))) + if self.search_text and not args.has_key(':search_text'): l.append(':search_text=%s'%self.search_text) - l.append(':pagesize=%s'%self.pagesize) - l.append(':startwith=%s'%self.startwith) + if not args.has_key(':pagesize'): + l.append(':pagesize=%s'%self.pagesize) + if not args.has_key(':startwith'): + l.append(':startwith=%s'%self.startwith) return '%s?%s'%(url, '&'.join(l)) def base_javascript(self):
--- a/roundup/templates/classic/html/issue.index Tue Sep 03 07:13:42 2002 +0000 +++ b/roundup/templates/classic/html/issue.index Tue Sep 03 07:33:01 2002 +0000 @@ -59,9 +59,10 @@ <td> <select name=":sort"> <option value="">- nothing -</option> - <option tal:repeat="col request/columns" - tal:attributes="value col; selected python:col == request.sort[1]" - tal:content="col">column</option> + <option tal:repeat="col klass/properties" + tal:attributes="value col/name; + selected python:col.name == request.sort[1]" + tal:content="col/name">column</option> </select> </td> <th>Descending:</th> @@ -74,9 +75,10 @@ <td> <select name=":group"> <option value="">- nothing -</option> - <option tal:repeat="col request/columns" - tal:attributes="value col; selected python:col == request.group[1]" - tal:content="col">column</option> + <option tal:repeat="col klass/properties" + tal:attributes="value col/name; + selected python:col.name == request.group[1]" + tal:content="col/name">column</option> </select> </td> <th>Descending:</th>
