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 = Database()
class Person(db.Entity):
name = Required(str)
class FooService(object):
name = 'foo_service'
db_session = PonySession(db)
@rpc
@db_session
def hello(self):
Person(name='hello')
Person(name='world')
@rpc
def world(self):
with self.db_session:
return [p.name for p in Person.select()]
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.3.1.win32.zip
(4.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nameko-pony-1.3.1.win32.zip.
File metadata
- Download URL: nameko-pony-1.3.1.win32.zip
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb78dcde95a3e3792b43da0645da2b440dcb516723f74d480e29dc78a49d256c
|
|
| MD5 |
db1bca4ededdaa7a0763ebdd957cbace
|
|
| BLAKE2b-256 |
443fd30dfd6b406eefe652b78465f79f17c84aa54bb4aaa80cbde6cf42414f24
|
File details
Details for the file nameko_pony-1.3.1-py2-none-any.whl.
File metadata
- Download URL: nameko_pony-1.3.1-py2-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
946bfe21ca8c2cab7476d7526fa9579df610e4fbe610956d828e8c280f707646
|
|
| MD5 |
cd4f9de729d742b3fe729f97b635b299
|
|
| BLAKE2b-256 |
e2c64f7caa04ffe4283c4865470cce1448a6294bd989c43090c12e38bd224e98
|