serveradmin icon indicating copy to clipboard operation
serveradmin copied to clipboard

Allow subscription to changes of object matching a Query

Open kofrezo opened this issue 5 years ago • 0 comments

This PR from @hasegeli aims to make it possible to subscribe to changes of objects matching a custom Query using the adminapi module. One can use the subscribe_changes method to register a callback to act on changes.

Example Usage:

>>> from adminapi.dataset import Query
>>>
>>> to_observe = Query({'responsible_admin': 'john.doe'})
>>> to_observe.subscribe_changes(lambda commit: print('Something changed {}'.format(commit))

Besides the age of the PR this is a great feature and it comes already with some improvements to the history which we aim for on the long term.

kofrezo avatar Jun 24 '20 06:06 kofrezo