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.

Source Distribution

django-observable-models-0.4.0.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file django-observable-models-0.4.0.tar.gz.

File metadata

  • Download URL: django-observable-models-0.4.0.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.17 CPython/3.7.4 Darwin/19.0.0

File hashes

Hashes for django-observable-models-0.4.0.tar.gz
Algorithm Hash digest
SHA256 498d191da78d1d832d0d8704887647f41cf579908926bdcb38ef572fbb1068e1
MD5 0b86981de6e00348580c616c281f327a
BLAKE2b-256 aa81b6fbbf6777875c21795887dc059bd8b2d8e0d6da0723f8de9e78dc8e94ce

See more details on using hashes here.

File details

Details for the file django_observable_models-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_observable_models-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef33fa0478578be772e58a66b11b432a4a9cb4411d4838ad5b9a2d1f53418e00
MD5 f1ac9e5abc0c6c0a91d6f98b7e98d4ed
BLAKE2b-256 642a824cbebe480914c2b07b2956d39dab44c971099e51766d11ad3e0c344aac

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page