A very micro http framework.
Project description
yhttp-pony
Pony ORM extension for yhttp.
Install
sudo apt install python3-dev libpq-dev postgresql # Postgresql
pip install yhttp-pony
Usage
This is how to use the extension.
from yhttp import Appliation, json
from yhttp.extensions import pony as ponyext
from pony.orm import db_session as dbsession, PrimaryKey, Required
app = Application()
app.settings.merge('''
db:
url: postgres://postgres:postgres@localhost/foo
''')
db = ponyext.install(app)
class Foo(db.Entity):
id = PrimaryKey(int, auto=True)
title = Required(str)
@app.route()
@json
@dbsession
def get(req):
return {f.id:f.title for f in Foo.select()}
app.ready()
Command line interface
There is some command line interfaces which will be automatically added to
your application when you call ponyext.install(app)
.
myapp db create
myapp db drop
Running tests
echo "ALTER USER postgres PASSWORD 'postgres'" | sudo -u postgres psql
make test
make cover
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
yhttp-pony-2.0.0.tar.gz
(5.2 kB
view hashes)
Built Distribution
yhttp_pony-2.0.0-py3.8.egg
(8.8 kB
view hashes)