home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 609453886

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions issue performed_via_github_app
https://github.com/simonw/datasette/issues/716#issuecomment-609453886 https://api.github.com/repos/simonw/datasette/issues/716 609453886 MDEyOklzc3VlQ29tbWVudDYwOTQ1Mzg4Ng== 9599 2020-04-05T17:38:38Z 2020-04-05T17:42:14Z OWNER

OK, here's the test harness. Three files:

check_view_name.py ```python import asyncio import pathlib from datasette.app import Datasette import httpx

root = pathlib.Path(file).parent

async def run_check(): ds = Datasette( [], template_dir=str(root / "templates"), plugins_dir=str(root / "plugins") ) async with httpx.AsyncClient(app=ds.app()) as client: response = await client.get("http://localhost/") assert 200 == response.status_code assert b"view_name:index" == response.content, response.content

if name == "main": loop = asyncio.get_event_loop() loop.run_until_complete(run_check()) ```

templates/index.html view_name:{{ view_name }} plugins/extra_vars.py ```python from datasette import hookimpl

@hookimpl def extra_template_vars(view_name): return {"view_name": view_name} ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
594168758  
Powered by Datasette · Queries took 0.917ms · About: github-to-sqlite