No project description provided
Project description
Django Observable Models
Django Observable Models allows you to subscribe to model operations using rxpy Observables. This is particularly useful for implementing things like GraphQL subscriptions.
Installation
$ pip install django-observable-models
Usage
# yourapp/models.py
from observable_models.models import ObservableModel
class YourModel(ObservableModel):
pass
# Subscribe to model creation
YourModel.model_events.pipe(filter(lamda event: event['operation'] == YourModel.CREATED))
# Subscribe to model updates
YourModel.model_events.pipe(filter(lamda event: event['operation'] == YourModel.UPDATED))
# Subscribe to model deletion
YourModel.model_events.pipe(filter(lamda event: event['operation'] == YourModel.DELETED))
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
Built Distribution
Close
Hashes for django-observable-models-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e08cd1b226bc25279e3811dfe98471cddf1bc1b7cddef787147e1cf3d0e2577 |
|
MD5 | 937914dd4e81a129d06236852e4458d6 |
|
BLAKE2b-256 | 23a374840355f1ea85b3122e0a7467fc9fef6730b42d80da0e20cedb3026afc0 |
Close
Hashes for django_observable_models-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c9e77870c4107e643d9ed22e2036510bc9c2a1bb87f18bbc64e8f9fe4702920 |
|
MD5 | eb5dcc210c0f425805a21ebdeec0a450 |
|
BLAKE2b-256 | 8c30f6aa50f7401dcdcd946517e9d7f95a8ce8ffc2ed12cb4f8d91763ca5c721 |