(request, page)
| 55 | @expose("/list/", defaults={"page": 1}) |
| 56 | @expose("/list/<int:page>") |
| 57 | def list(request, page): |
| 58 | def wrap(doc): |
| 59 | data = doc.value |
| 60 | data["_id"] = doc.id |
| 61 | return URL.wrap(data) |
| 62 | |
| 63 | code = """function(doc) { if (doc.public){ map([doc._id], doc); }}""" |
| 64 | docResults = URL.query(code) |
| 65 | results = [wrap(doc) for doc in docResults] |
| 66 | pagination = Pagination(results, 1, page, "list") |
| 67 | if pagination.page > 1 and not pagination.entries: |
| 68 | raise NotFound() |
| 69 | return render_template("list.html", pagination=pagination) |
| 70 | |
| 71 | |
| 72 | def not_found(request): |
searching dependent graphs…