Skip to main content

Events watcher is an event packaging library for Django to track changes made in your models.

Project description

Add new events for auth.users:

In [4]: from events_watcher.bridge import backend as events
In [5]: user = User.objects.create_user('newbie', 'newbie@example.com', '$ecret')

In [6]: events.add('subscription', user)
Out[6]: <Event: subscription for newbie>

In [7]: events.add('subscription', user, date=user.date_joined)
Out[7]: <Event: subscription for newbie>

List all events for auth.users:

In [12]: events.list(user)
Out[12]: [<Event: subscription for newbie>, <Event: subscription for newbie>]

In [13]: events.add('last_login', user, date=user.last_login)
Out[13]: <Event: last_login for newbie>

In [14]: events.list('last_login')
Out[14]: [<Event: last_login for newbie>]

Retrieve only one event for a specific event name and auth.users:

In [16]: events.retrieve('last_login', user)
Out[16]: <Event: last_login for newbie>

Remove all events with a specific event name:

In [17]: events.remove('last_login')

Installation

python setup.py install

OR

put the events_watcher folder on your python-path

Add events_watcher.backends.database to your INSTALLED_APPS if you want to use the RDMS backend connector with the Django ORM.

Roadmap

Currently only databases shipped with the default Django ORM is supported and the API is very simple.

Custom backends could be done to store results in NoSQL databases like: redis or MongoDB.

Notes

events_watcher uses a load_class helper in its utils module which can be found at django-shop.

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-events-watcher-0.2.1.tar.gz (6.2 kB view details)

Uploaded Source

File details

Details for the file django-events-watcher-0.2.1.tar.gz.

File metadata

File hashes

Hashes for django-events-watcher-0.2.1.tar.gz
Algorithm Hash digest
SHA256 2be9544c5911e2f3fa53a6bfe16b2cc202de23026eb6df3fa7d033ae0df8e624
MD5 b6c5235f80a36edbf3cf94275b58a946
BLAKE2b-256 d95277ccf9954cbaaca3d567514997d99c16ea8f6f0ed49de516cf9932dda143

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