Allows handle PostgreSQL notifies via listener as regular Django signal.
Project description
# Django PostgreSQL Signals
This django app allows you to pass events about database changes directly into Djano as regular signal.
# Install
## Pypi
```
pip install pgsignals
```
# Usage
**settings.py**
```
INSTALLED_APPS = [
"pgsignals",
...
]
PGSIGNALS_OBSERVABLE_MODELS = [
"myapp.ModelA",
"myapp.ModelB",
]
```
**apps.py**
```
from pgsignals.signals import pgsignals_event
class MyAppConf(AppConf):
def ready():
pgsignals_event.connect(on_pg_event)
def on_pg_event(*args, **kwargs):
event = kwargs['event']
model = kwargs['sender']
# Do some useful stuff here
```
This django app allows you to pass events about database changes directly into Djano as regular signal.
# Install
## Pypi
```
pip install pgsignals
```
# Usage
**settings.py**
```
INSTALLED_APPS = [
"pgsignals",
...
]
PGSIGNALS_OBSERVABLE_MODELS = [
"myapp.ModelA",
"myapp.ModelB",
]
```
**apps.py**
```
from pgsignals.signals import pgsignals_event
class MyAppConf(AppConf):
def ready():
pgsignals_event.connect(on_pg_event)
def on_pg_event(*args, **kwargs):
event = kwargs['event']
model = kwargs['sender']
# Do some useful stuff here
```
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for pgsignals-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83a1ea6b7315da173d5fa42a414cb5191abf0af1e2f30d5d4c1c33953ab452ad |
|
MD5 | 777238f8fc9d625bad3109c8e3b4f3a3 |
|
BLAKE2b-256 | b9a1c2a9d2a3f8356bed6f9f02816fd54126685240da53c908627505ad473fd3 |