Skip to main content

Pony dependency for nameko services

Project description

nameko-pony

Pony dependency for nameko services

Installation

pip install nameko-pony

Usage

app.py

from nameko.rpc import rpc
from pony.orm import Database, Required
from nameko_pony import PonySession, db_session


db = Database()

class Person(db.Entity):
    name = Required(str)


class MyService(object):
    name = "my_service"

    pony_session = PonySession(db)

    @rpc
    def hello(self, name):
        with self.pony_session:
            Person(name=name)


    @rpc
    @db_session
    def world(self, name):
        Person(name=name)

config.yml

AMQP_URI: 'pyamqp://guest:guest@localhost'
DATABASE_URI: 'sqlite:///:memory:'
# DATABASE_URI: 'mysql://usr:pwd@localhost/db_name'

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

nameko-pony-1.2.5.win32.zip (4.2 kB view details)

Uploaded Source

Built Distribution

nameko_pony-1.2.5-py2-none-any.whl (2.5 kB view details)

Uploaded Python 2

File details

Details for the file nameko-pony-1.2.5.win32.zip.

File metadata

File hashes

Hashes for nameko-pony-1.2.5.win32.zip
Algorithm Hash digest
SHA256 451a98253fb34e08269359e621cb9fe2d35c3511028e23d265a2f649396b1e6e
MD5 398a32d19a3e35cd654785bea80fd0dc
BLAKE2b-256 563c9985c89b3bd79a28ab0ed422a7f721ad11da9cb6b013e2e2a1680205a795

See more details on using hashes here.

File details

Details for the file nameko_pony-1.2.5-py2-none-any.whl.

File metadata

File hashes

Hashes for nameko_pony-1.2.5-py2-none-any.whl
Algorithm Hash digest
SHA256 2aee18ad20cbbab2a8f91b0232f8d3b8aa2af1c46dbac15fec9284f307c70082
MD5 8e77c816ae4d9a5d6f8e3d428b600592
BLAKE2b-256 bc3848c9a720bdc7055876c798d96bef801ec428f19ed8e52d53e78ec5697358

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