Skip to main content

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.

Files for django-observable-models, version 0.4.0
Filename, size File type Python version Upload date Hashes
Filename, size django_observable_models-0.4.0-py3-none-any.whl (2.4 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size django-observable-models-0.4.0.tar.gz (1.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page