django-rest-hooks
django-rest-hooks copied to clipboard
Hook Data Templates
Hi!
We've been thinking about our shiny new RestHooks and thought that it would be neat if there was another column in the Hooks table that let you define an option "template" for the hook data if the hook destination needed it in an alternative format.
Very Simple example. Say I have this normal hook response defined in serialize_hook, but the data destination is expecting "phone_number" instead of "from_number":
data = {
'from_number': self.from_number
}
With hook templates I could change that to:
{
'phone_number': {from_number}
}
Thoughts?
-Lyle