smebberson/linz — pull request #22 by smebberson (2014-06-01 05:57:31+00:00)
Title: Value transform

This PR provides configuration to transform field values, prior to saving them in the database. It follows the following workflow:

- create / edit form is rendered
- users fills in data
- users hits save, and form is POSTed
- linz goes through each field, and if found, runs a transform function
- linz overrides the value from the form post and saves to the database

Transform methods are provided in the form key of the linz.formtools.plugin configuration object:

```js
redirects: {
label: 'Label',
transform: function transform (value, mode) {
return value.split(',');
}
}
```

Mode will be set to `beforeSave`. In time, we might provide a means to transform a value between database retrieval and form generation, and the `mode` argument allows the user to determine at which point the transform function is being execute. Although, it may not matter to the user.

If you like it, it's ready to pull.