Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

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

Project Description
## Baka model add-ons

[Baka_model](https://github.com/suryakencana/baka_model) 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`.

# Usage

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'

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

# Register Model

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

```
def includeme(config):
config.register_model('base.MyModel')


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

return {'success': True}

```
Release History

Release History

This version
History Node

0.17.1

History Node

0.17.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
baka_model-0.17.1.tar.gz (12.5 kB) Copy SHA256 Checksum SHA256 Source Mar 17, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting