-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set field value a a variable depending on another fields value #20
Comments
At resource level you can bind the Insert and Update events to compute this field. See Hooks for more info. |
Ok for example i should use inserteventhandlerfunc which has an oninsert method taking a context and a payload (map[string]interface) and here the payload is the map of field names/values of my resources, defined via the schema. Right? So I can access their "final" values and manipulate them before sending to the storer. Is that the procedure ? (Sorry to bother you but I'm on my phone so i can not try the procedure instead of asking you to confirm that this is what you meant) |
That's exactly the idea yes. |
Okay perfect, I'll try it. I was missing the part where I have access to the final representation of the data, as transfered to the storer ... therefor was I locked in the "schema" phase with init/update functions that can be attached to the field, but fields values are isolated in the schema ... this was where I got stuck. Thank you for your response :) Have you delivered a ffew projects using rest-layer yet? |
For example on a schema I could have fields such as "city"=city and "business-name"=the_name. And use those to build a url friendly id and access the page via domain.com/business/the_name_city.
What would be the easiest way to do it?
I don't really understand how to access the data in it's "storable" version once compiled from the schema ...
The text was updated successfully, but these errors were encountered: