Browse Source

Updated example extension

master 0.2.0
benarc 4 years ago
parent
commit
503c981bc9
  1. 11
      lnbits/extensions/example/migrations.py
  2. 11
      lnbits/extensions/example/models.py
  3. 4
      lnbits/extensions/example/views_api.py

11
lnbits/extensions/example/migrations.py

@ -0,0 +1,11 @@
#async def m001_initial(db):
# await db.execute(
# """
# CREATE TABLE IF NOT EXISTS example (
# id TEXT PRIMARY KEY,
# wallet TEXT NOT NULL,
# time TIMESTAMP NOT NULL DEFAULT (strftime('%s', 'now'))
# );
# """
# )

11
lnbits/extensions/example/models.py

@ -0,0 +1,11 @@
#from sqlite3 import Row
#from typing import NamedTuple
#class Example(NamedTuple):
# id: str
# wallet: str
#
# @classmethod
# def from_row(cls, row: Row) -> "Example":
# return cls(**dict(row))

4
lnbits/extensions/example/views_api.py

@ -21,8 +21,8 @@ async def api_example():
"""Try to add descriptions for others."""
tools = [
{
"name": "Flask",
"url": "https://flask.palletsprojects.com/",
"name": "Quart",
"url": "https://pgjones.gitlab.io/quart/",
"language": "Python",
},
{

Loading…
Cancel
Save