Paginate Macro
This doc was last edited by Administrator March 16, 2009.
plugin
upstream
Templates in the website are disabled now. Editing them will not have any effect on the live website.
1
2
3
4
5
6
7
8
9
10
11
12
|
$def with (path="", limit=50, use_repr=False)
$ page = safeint(query_param("page", "0"))
$ pages = list_pages(path, limit=limit, offset=page * limit)
<div class="copyright-footer">
$if page != 0:
← <a href="$:changequery(page=page - 1)" rel="nofollow">$_.prev</a>
$if len(pages) == limit:
... <a href="$:changequery(page=page + 1)" rel="nofollow">$_.next</a> →
<div> |
Debug Stats
SUMMARY
total: {'count': 0, 'unaccounted': 0.067839622497558594, 'time': 0.11342096328735352}
memcache.get: {'count': 5, 'time': 0.004650115966796875}
infobase: {'count': 2, 'time': 0.038451194763183594}
memcache.set: {'count': 1, 'time': 0.0013940334320068359}
memcache.get_multi: {'count': 1, 'time': 0.0010859966278076172}
Details
memcache.get 0.00134301185608
{'hit': True, 'key': u'/macros/Paginate'}
memcache.get 0.000971078872681
{'hit': False, 'key': 'd/macros/Paginate'}
infobase 0.0211341381073
{'path': '/openlibrary.org/versions', 'data': {'query': '{"limit": 5, "key": "/macros/Paginate", "offset": 0}'}, 'method': 'GET'}
memcache.get 0.000859022140503
{'hit': False, 'key': 'd/macros/Paginate'}
memcache.set 0.00139403343201
{'key': 'd/macros/Paginate'}
memcache.get_multi 0.00108599662781
{'found': 2}
memcache.get 0.00110387802124
{'hit': True, 'key': u'/type/macro'}
infobase 0.0173170566559
{'path': '/openlibrary.org/versions', 'data': {'query': '{"limit": 1, "key": "/macros/Paginate", "offset": 0}'}, 'method': 'GET'}
memcache.get 0.000373125076294
{'hit': True, 'key': 'inlibrary.libraries-hash'}