Generic backend pool
Project description
Generic backend pool for Django
Setup
pip install ramos
Requirements
Ramos uses Django or Simple Settings to get backends configurations.
Usage
Settings
POOL_OF_RAMOS = {
'backend_type': [
'path.to.backend_a',
'path.to.backend_b',
]
}
Backend Implementations
from ramos.mixins import ThreadSafeCreateMixin
class BackendA(ThreadSafeCreateMixin):
id = 'backend_a'
def say(self):
return 'A'
class BackendB(ThreadSafeCreateMixin):
id = 'backend_b'
def say(self):
return 'B'
Backend Pool
from ramos.pool import BackendPool
class BackendTypePool(BackendPool)
backend_type = 'backend_type'
backends = BackendTypePool.all()
for backend in backends:
print(backend.say())
# backend_a = BackendTypePool.get('backend_a')
# backend_b = BackendTypePool.get('backend_b')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ramos-1.0.0.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for ramos-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84d5bde1374a9f4fc7925eec23f401d302d157b60f2fa889cd6638c23693d493 |
|
MD5 | c30a2e08ffe8e787730a81adc4909493 |
|
BLAKE2b-256 | e6d0aa8a6ebab8ead23e1fcbbe27297bd53060b07815dc68554a1a1cedde0679 |