limit to 20 by default

This commit is contained in:
posativ 2012-10-24 23:56:52 +02:00
parent 6bb7b8c8d9
commit 66cc7911f5
2 changed files with 5 additions and 5 deletions

View File

@ -61,7 +61,7 @@
<span class="limit"> <span class="limit">
[ <a href="?${query(pendinglimit=10)}">10</a> [ <a href="?${query(pendinglimit=10)}">10</a>
| <a href="?${query(pendinglimit=20)}">20</a> | <a href="?${query(pendinglimit=20)}">20</a>
| <a href="?${query(pendinglimit=0)}">All</a> ] | <a href="?${query(pendinglimit=100000)}">All</a> ]
</span> </span>
% for comment in app.db.recent(limit=get('pendinglimit', int), mode=2): % for comment in app.db.recent(limit=get('pendinglimit', int), mode=2):
@ -74,10 +74,10 @@
<span class="limit"> <span class="limit">
[<a href="?${query(recentlimit=10)}">10</a> [<a href="?${query(recentlimit=10)}">10</a>
| <a href="?${query(recentlimit=20)}">20</a> | <a href="?${query(recentlimit=20)}">20</a>
| <a href="?${query(recentlimit=0)}">All</a>] | <a href="?${query(recentlimit=100000)}">All</a>]
</span> </span>
% for comment in app.db.recent(limit=get('recentlimit', int), mode=5): % for comment in app.db.recent(limit=get('recentlimit', int) or 20, mode=5):
${make(comment)} ${make(comment)}
% endfor % endfor

View File

@ -94,8 +94,8 @@ class TestComments(unittest.TestCase):
def testDeleteWithReference(self): def testDeleteWithReference(self):
client = Client(self.app, Response) client = Client(self.app, Response)
resp = client.post('/1.0/path/new', data=json.dumps(comment(text='First'))) client.post('/1.0/path/new', data=json.dumps(comment(text='First')))
self.post('/1.0/path/new', data=json.dumps(comment(text='Second', parent=1))) client.post('/1.0/path/new', data=json.dumps(comment(text='First', parent=1)))
r = client.delete('/1.0/path/1') r = client.delete('/1.0/path/1')
assert r.status_code == 200 assert r.status_code == 200