UNKNOWN
Project description
Muffin-SqlAlchemy – A simple sqlalchemy helper plugin for muffin framework.
Requirements
python >= 3.4
muffin >= 0.5.5
Installation
Muffin-SqlAlchemy should be installed using pip:
pip install muffin-sqlalchemy
Usage
Add muffin-sqlalchemy to muffin plugin list:
import muffin
app = muffin.Application(
'example',
PLUGINS=(
'muffin_sqlalchemy',
)
)
And use sqlalchemy session in request object:
@app.register('/foo')
class Example(muffin.Handler):
@asyncio.coroutine
def post(self, request):
foo = FooModel(name='foo')
session = request.sqlalchemy_session
session.add(foo)
session.commit()
return 'Ok'
Options
SQLALCHEMY_DATABASE_URI |
URI of database (sqlite:///muffin.db) |
Commands
The plugin adds some commands to your Muffin application.
Create Databse
Create all tables in database according to you engine:
$ muffin app_module create_databse
to work fine inherit from muffin_sqalchemy.SqlAlchemyDeclarativeBase to create yours sqlalchemy models
Bug tracker
If you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/drgarcia1986/muffin-sqlalchemy/issues
Contributing
Development of Muffin-Memcached happens at: https://github.com/drgarcia1986/muffin-sqlalchemy
Contributors
drgarcia1986 (Diego Garcia)
License
Licensed under a MIT license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file muffin-sqlalchemy-0.0.2.tar.gz
.
File metadata
- Download URL: muffin-sqlalchemy-0.0.2.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f87fc13a3c41afa2940e2aeae6f349c95fbe8f5931f741f60cf2feac5ff0d95 |
|
MD5 | 24f8dba0ae3e610158aade0c1c72e10d |
|
BLAKE2b-256 | c3706986087bbb8a7282c19565940206a720f81343617a722c4feaf5e7aee77a |