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)
Built Distribution
File details
Details for the file nameko-pony-1.2.5.win32.zip
.
File metadata
- Download URL: nameko-pony-1.2.5.win32.zip
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 451a98253fb34e08269359e621cb9fe2d35c3511028e23d265a2f649396b1e6e |
|
MD5 | 398a32d19a3e35cd654785bea80fd0dc |
|
BLAKE2b-256 | 563c9985c89b3bd79a28ab0ed422a7f721ad11da9cb6b013e2e2a1680205a795 |
File details
Details for the file nameko_pony-1.2.5-py2-none-any.whl
.
File metadata
- Download URL: nameko_pony-1.2.5-py2-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2aee18ad20cbbab2a8f91b0232f8d3b8aa2af1c46dbac15fec9284f307c70082 |
|
MD5 | 8e77c816ae4d9a5d6f8e3d428b600592 |
|
BLAKE2b-256 | bc3848c9a720bdc7055876c798d96bef801ec428f19ed8e52d53e78ec5697358 |