home / github / issue_comments

Menu
  • GraphQL API

issue_comments: 381621338

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/14#issuecomment-381621338 https://api.github.com/repos/simonw/datasette/issues/14 381621338 MDEyOklzc3VlQ29tbWVudDM4MTYyMTMzOA== 9599 2018-04-16T14:36:27Z 2018-04-16T14:36:27Z OWNER Annoyingly, the following only results in the last of the two `prepare_connection` hooks being registered: ``` from datasette import hookimpl import pint import random ureg = pint.UnitRegistry() @hookimpl def prepare_connection(conn): def convert_units(amount, from_, to_): "select convert_units(100, 'm', 'ft');" return (amount * ureg(from_)).to(to_).to_tuple()[0] conn.create_function('convert_units', 3, convert_units) @hookimpl def prepare_connection(conn): conn.create_function('random_integer', 2, random.randint) ``` {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} 267707940  
Powered by Datasette · Queries took 0.971ms