Skip to main content

UNKNOWN

Project description

Muffin-Alchemy – A simple sqlalchemy helper plugin for muffin framework.

Build Status

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_ENGINE

Engine to connect in 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

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

muffin-sqlalchemy-0.0.1.tar.gz (4.0 kB view details)

Uploaded Source

File details

Details for the file muffin-sqlalchemy-0.0.1.tar.gz.

File metadata

File hashes

Hashes for muffin-sqlalchemy-0.0.1.tar.gz
Algorithm Hash digest
SHA256 2e11365ebd9ccfa61e7849d1ebabbfddc92a659cb81a441f9f167141c47e9291
MD5 dbfe60b47ce5e927b9fab02c1c7a92d4
BLAKE2b-256 3be271af7a175585a980d93a152e448318547dde56d5d3a7df10ee56a5afc1af

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page