-
Notifications
You must be signed in to change notification settings - Fork 133
Hook Data Templates #4
Comments
Adding initial South migration
@lylepratt I realize it has been almost two years since you have made this issue so I do apologize for getting to it so late. Looking at the feature request, it appears that you could currently do this with Django's Template engine. This in turn could create the ideal payload based on your own criteria. Further following separation's of concerns, I feel more inclined to say that your feature really belongs outside the scope of django-rest-hooks. I am of course open for more discourse on this to possibly drill down the root of the feature. (i.e. what is django-rest-hooks lacking). -Andrew |
Hi Andrew, Yes its definitely possible to use Django template for the data transformation. However, the template would need to be stored with the Hook data and users would need to be able to pass in their own "data templates" when they create hooks using the Rest API. Essentially, this would require an additional model field, and if the hook model contained a valid template in that field, it should run the transformation right before sending off the hook. |
Seems like you can do this now with the |
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":
With hook templates I could change that to:
Thoughts?
-Lyle
The text was updated successfully, but these errors were encountered: