Skip to content
This repository has been archived by the owner on Jul 9, 2020. It is now read-only.

klen/bottle-peewee

Repository files navigation

Bottle Peewee

Bottle Peewee -- Provide Peewee ORM integration to Bottle framework.

Build Status Coverals http://img.shields.io/pypi/v/bottle-peewee.svg?style=flat-square http://img.shields.io/pypi/dm/bottle-peewee.svg?style=flat-square Donate
  • python >= 2.6

Bottle Peewee should be installed using pip:

pip install bottle-peewee
from bottle import Bottle
from bottle_peewee import PeeweePlugin
from peewee import Model, CharField

app = Bottle()
db = PeeweePlugin('sqlite:///:memory:')

class User(Model):
    name = CharField()

    class Meta(object):
        database = db.proxy

app.install(db)

db.database.create_table(User)
User.create(name='test')
assert [user for user in User.select()]

PEEWEE_CONNECTION -- A connection string to database

If you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/klen/bottle-peewee/issues

Development of Bottle Peewee happens at: https://github.com/klen/bottle-peewee

  • klen (Kirill Klenov)

Licensed under a BSD license.

About

Integrate Peewee ORM to Bottle framework

Resources

License

Stars

Watchers

Forks

Packages

No packages published