Skip to content

Commit 1e3aa92

Browse files
author
Richard Jones
committed
allow overiding of the index args roundup/cgi/templating.py
1 parent 2cfa37d commit 1e3aa92

File tree

4 files changed

+37
-20
lines changed

4 files changed

+37
-20
lines changed

roundup/backends/back_anydbm.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
#$Id: back_anydbm.py,v 1.68 2002-09-03 05:46:20 richard Exp $
18+
#$Id: back_anydbm.py,v 1.69 2002-09-03 07:33:01 richard Exp $
1919
'''
2020
This module defines a backend that saves the hyperdatabase in a database
2121
chosen by anydbm. It is guaranteed to always be available in python
@@ -175,8 +175,8 @@ def opendb(self, name, mode):
175175
# new database? let anydbm pick the best dbm
176176
if not db_type:
177177
if __debug__:
178-
print >>hyperdb.DEBUG, "opendb anydbm.open(%r, 'n')"%path
179-
return anydbm.open(path, 'n')
178+
print >>hyperdb.DEBUG, "opendb anydbm.open(%r, 'c')"%path
179+
return anydbm.open(path, 'c')
180180

181181
# open the database with the correct module
182182
try:
@@ -1909,6 +1909,9 @@ def __init__(self, db, classname, **properties):
19091909

19101910
#
19111911
#$Log: not supported by cvs2svn $
1912+
#Revision 1.68 2002/09/03 05:46:20 richard
1913+
#handle disappearing users for journaltags
1914+
#
19121915
#Revision 1.67 2002/09/03 02:53:53 richard
19131916
#Fixed nasty bug that was preventing changes to multilinks going through.
19141917
#

roundup/backends/back_bsddb.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
#$Id: back_bsddb.py,v 1.20 2002-07-19 03:36:34 richard Exp $
18+
#$Id: back_bsddb.py,v 1.21 2002-09-03 07:33:01 richard Exp $
1919
'''
2020
This module defines a backend that saves the hyperdatabase in BSDDB.
2121
'''
@@ -61,8 +61,8 @@ def opendb(self, name, mode):
6161
path = os.path.join(os.getcwd(), self.dir, name)
6262
if not os.path.exists(path):
6363
if __debug__:
64-
print >>hyperdb.DEBUG, "opendb bsddb.open(%r, 'n')"%path
65-
return bsddb.btopen(path, 'n')
64+
print >>hyperdb.DEBUG, "opendb bsddb.open(%r, 'c')"%path
65+
return bsddb.btopen(path, 'c')
6666

6767
# open the database with the correct module
6868
if __debug__:
@@ -131,6 +131,15 @@ def doSaveJournal(self, classname, nodeid, action, params):
131131

132132
#
133133
#$Log: not supported by cvs2svn $
134+
#Revision 1.20 2002/07/19 03:36:34 richard
135+
#Implemented the destroy() method needed by the session database (and possibly
136+
#others). At the same time, I removed the leading underscores from the hyperdb
137+
#methods that Really Didn't Need Them.
138+
#The journal also raises IndexError now for all situations where there is a
139+
#request for the journal of a node that doesn't have one. It used to return
140+
#[] in _some_ situations, but not all. This _may_ break code, but the tests
141+
#pass...
142+
#
134143
#Revision 1.19 2002/07/14 02:05:53 richard
135144
#. all storage-specific code (ie. backend) is now implemented by the backends
136145
#

roundup/cgi/templating.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,28 +1096,31 @@ def indexargs_form(self, columns=1, sort=1, group=1, filter=1,
10961096
def indexargs_href(self, url, args):
10971097
''' embed the current index args in a URL '''
10981098
l = ['%s=%s'%(k,v) for k,v in args.items()]
1099-
if self.columns:
1099+
if self.columns and not args.has_key(':columns'):
11001100
l.append(':columns=%s'%(','.join(self.columns)))
1101-
if self.sort[1] is not None:
1101+
if self.sort[1] is not None and not args.has_key(':sort'):
11021102
if self.sort[0] == '-':
11031103
val = '-'+self.sort[1]
11041104
else:
11051105
val = self.sort[1]
11061106
l.append(':sort=%s'%val)
1107-
if self.group[1] is not None:
1107+
if self.group[1] is not None and not args.has_key(':group'):
11081108
if self.group[0] == '-':
11091109
val = '-'+self.group[1]
11101110
else:
11111111
val = self.group[1]
11121112
l.append(':group=%s'%val)
1113-
if self.filter:
1113+
if self.filter and not args.has_key(':columns'):
11141114
l.append(':filter=%s'%(','.join(self.filter)))
11151115
for k,v in self.filterspec.items():
1116-
l.append('%s=%s'%(k, ','.join(v)))
1117-
if self.search_text:
1116+
if not args.has_key(k):
1117+
l.append('%s=%s'%(k, ','.join(v)))
1118+
if self.search_text and not args.has_key(':search_text'):
11181119
l.append(':search_text=%s'%self.search_text)
1119-
l.append(':pagesize=%s'%self.pagesize)
1120-
l.append(':startwith=%s'%self.startwith)
1120+
if not args.has_key(':pagesize'):
1121+
l.append(':pagesize=%s'%self.pagesize)
1122+
if not args.has_key(':startwith'):
1123+
l.append(':startwith=%s'%self.startwith)
11211124
return '%s?%s'%(url, '&'.join(l))
11221125

11231126
def base_javascript(self):

roundup/templates/classic/html/issue.index

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@
5959
<td>
6060
<select name=":sort">
6161
<option value="">- nothing -</option>
62-
<option tal:repeat="col request/columns"
63-
tal:attributes="value col; selected python:col == request.sort[1]"
64-
tal:content="col">column</option>
62+
<option tal:repeat="col klass/properties"
63+
tal:attributes="value col/name;
64+
selected python:col.name == request.sort[1]"
65+
tal:content="col/name">column</option>
6566
</select>
6667
</td>
6768
<th>Descending:</th>
@@ -74,9 +75,10 @@
7475
<td>
7576
<select name=":group">
7677
<option value="">- nothing -</option>
77-
<option tal:repeat="col request/columns"
78-
tal:attributes="value col; selected python:col == request.group[1]"
79-
tal:content="col">column</option>
78+
<option tal:repeat="col klass/properties"
79+
tal:attributes="value col/name;
80+
selected python:col.name == request.group[1]"
81+
tal:content="col/name">column</option>
8082
</select>
8183
</td>
8284
<th>Descending:</th>

0 commit comments

Comments
 (0)