Skip to content

Commit e4a43c0

Browse files
author
Niels Verbeek
committed
feat(copy): adds documentation for datasource on_copy
1 parent 0c0d69e commit e4a43c0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

forms/data-sources.md

+7
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ For the label, it's possible to use a dict with translated values.
3737

3838
Note: If the labels returned from`get_data()` depend on the current user's language, you need to return a `dict` with the language code as keys instead of translating the value yourself. Returning already translated values is not supported, as it would break caching and validation.
3939

40+
### `on_copy`-method
41+
42+
Must return tuple with a slug and a label. This method is called when a form answer with dynamic options is copied. It is used to optionally alter the slug and label of the dynamic option.
43+
By default it will return the input slug and label without modifying it.
44+
45+
When returning a None value for the slug the dynamic option will be discarded.
46+
4047
#### Arguments
4148

4249
* `user`: The OIDC user object for the request

0 commit comments

Comments
 (0)