-
Notifications
You must be signed in to change notification settings - Fork 132
Dynamic HOOK_EVENTS #32
Comments
HOOK_EVENTS settings originally had a goal with connecting into Django models post/pre save signals. This allowed signal registration upon application startup and firing would be provided by Django's signals framework. HOOK_EVENTS validation can be suppressed somewhat easily. The remaining challenge is to ensure that event firing occurs consistently. This will almost certainly require manual hook event method calls. |
A little more detail about my specific use-case since I feel the feedback might be useful, regardless of whether I end up solving my problem with this library. I am contemplating using https://github.com/justquick/django-activity-stream to get most of the functionality I want, i.e. keep track of actions performed against a model (regardless of webhooks). Additionally to that, what I need to be able to do is define webhooks that subscribe to that model – and listen on either all or some of the events/verbs emitted.
I don't expect I'll get very far with this considering the deviations above without a lot of monkey patching so I might just liberate some aspects of the design, unless any of this stuff is functionality that might be desirable here for others. |
@stevelacey If you are not to interested in a user property association then this library will not likely provide a lot of utility. Thanks for explaining what you are trying to accomplish. It might be a feature this library could look into being able to provide. |
I second this. I need the ownership of a webhook to refer to a different model and not with the User model. It would be nice to be able to use this library for that purpose. |
@Ryanb58 You can do this by creating your own hook class that inherits AbstractHook and then implementing a custom hook finder method. Custom hook class
Here is my hook finder method where I fire if a hook has been set up for a business.
Settings
|
I am implementing a webhook-like system, and your library looks to fit the bill – however, I need to define hooks on the fly – they're based on statuses stored in the database that the users/admins can customise – just wondering why you require settings be defined in advance in settings.py, and what problems I'd run into ripping out that validation.
The text was updated successfully, but these errors were encountered: