From 6f0f2f031943e19ae93cc6367de38c3e692d6f82 Mon Sep 17 00:00:00 2001 From: richard Date: Tue, 3 Sep 2002 07:33:01 +0000 Subject: [PATCH] allow overiding of the index args roundup/cgi/templating.py git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1047 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup/backends/back_anydbm.py | 9 ++++++--- roundup/backends/back_bsddb.py | 15 ++++++++++++--- roundup/cgi/templating.py | 19 +++++++++++-------- roundup/templates/classic/html/issue.index | 14 ++++++++------ 4 files changed, 37 insertions(+), 20 deletions(-) diff --git a/roundup/backends/back_anydbm.py b/roundup/backends/back_anydbm.py index f1f70fc..46c44d1 100644 --- a/roundup/backends/back_anydbm.py +++ b/roundup/backends/back_anydbm.py @@ -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 @@ class Database(FileStorage, hyperdb.Database, roundupdb.Database): # 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 @@ class IssueClass(Class, roundupdb.IssueClass): # #$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. # diff --git a/roundup/backends/back_bsddb.py b/roundup/backends/back_bsddb.py index 6e14a6e..5984078 100644 --- a/roundup/backends/back_bsddb.py +++ b/roundup/backends/back_bsddb.py @@ -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 @@ class Database(Database): 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 @@ class Database(Database): # #$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 # diff --git a/roundup/cgi/templating.py b/roundup/cgi/templating.py index 27ab476..d2c5ae1 100644 --- a/roundup/cgi/templating.py +++ b/roundup/cgi/templating.py @@ -1096,28 +1096,31 @@ env: %(env)s 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): diff --git a/roundup/templates/classic/html/issue.index b/roundup/templates/classic/html/issue.index index 420d0e6..7474192 100644 --- a/roundup/templates/classic/html/issue.index +++ b/roundup/templates/classic/html/issue.index @@ -59,9 +59,10 @@ Descending: @@ -74,9 +75,10 @@ Descending: -- 2.30.2