Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

baka-tenshi

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

baka-tenshi

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

  • 1.0.3
  • PyPI
  • Socket score

Maintainers
1

Baka model add-ons

Baka_tenshi <https://github.com/suryakencana/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.

Usage

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

.. code:: python

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_tenshi, you can apply dependency injection method for model that has been created.

.. code:: python

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}

Install

Install with .ini file

.. code:: bash pyramid.includes = Baka_tenshi pyramid_debugtoolbar pyramid_mailer

Install with code

.. code:: python

def includeme(config):
    config.include('Baka_tenshi')

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc