Skip to main content

Baka: Skeleton framework built top of pyramid, baka_tenshi for sqlalchemy

Project description

Baka model add-ons

Baka_tenshi is add-ons baka framework built top of pyramid that provides an SQLAlchemy declarative Base alias model.Model and a add method on request.db.


You can use these as base classes for declarative model definitions, e.g.

from base_model.model import Model

class MyModel(Model):
    """Example model class."""

    __tablename__ = 'base.mymodel'

    def do_first(cls, session):
    instance = session.query(cls).first()

Register Model

using Baka_tenshi, you can apply dependency injection method for model that has been created.

def includeme(config):

# in view handler request
@route('/my.model', renderer='json')
def view_mymodel(request):
    MyModel = request.find_model('base.mymodel')
    mymodel = MyModel() = 'user model'
    mymodel.address = 'user address' = '0089800-998'

    return {'success': True}


Install with .ini file

pyramid.includes =

Install with code

def includeme(config):

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

baka_tenshi-1.0.3.dev9.tar.gz (11.1 kB view hashes)

Uploaded source

Built Distribution

baka_tenshi-1.0.3.dev9-py2.py3-none-any.whl (12.8 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page