MCPcopy
hub / github.com/pallets/werkzeug / list

Function list

examples/couchy/views.py:57–69  ·  examples/couchy/views.py::list
(request, page)

Source from the content-addressed store, hash-verified

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

Callers 15

run_wsgi_appFunction · 0.50
__init__Method · 0.50
security.pyFile · 0.50
__init__Method · 0.50
_iter_module_pathsFunction · 0.50
_find_stat_pathsFunction · 0.50
_find_watchdog_pathsFunction · 0.50
applicationMethod · 0.50
_ensure_sequenceMethod · 0.50
make_sequenceMethod · 0.50
freezeMethod · 0.50
render_debugger_htmlMethod · 0.50

Calls 5

NotFoundClass · 0.90
wrapFunction · 0.85
queryMethod · 0.80
PaginationClass · 0.70
render_templateFunction · 0.70

Tested by 15

run_wsgi_appFunction · 0.40
test_proxy_localFunction · 0.40
test_proxy_listFunction · 0.40
test_acceptMethod · 0.40
test_set_headerMethod · 0.40
test_run_wsgi_appsFunction · 0.40
test_access_routeFunction · 0.40
test_form_data_orderingFunction · 0.40
test_find_modulesFunction · 0.40