add: form creation with attachments #92
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #79
What has been done to verify that this works as intended?
New tests, checked E2E result in Central
Why is this the best possible solution? Were any other approaches considered?
Follows a similar pattern to forms.update but without the version update, and a definition is required. The attachment upload and publish are separate calls because the form creation endpoint in Central accepts only a form definition.
The returned Form object doesn't include info about the attachments, because if an upload fails then an error will be raised (before the form is published), so a user could assume that no error means all attachments were uploaded.
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
New convenience feature to avoid needing to create then update just to upload attachments.
Do we need any specific form for testing your changes? If so, please attach one.
No
Does this change require updates to documentation? If so, please file an issue here and include the link below.
The method docstring is updated with the new parameter.
Before submitting this PR, please make sure you have:
tests
python -m unittest
and verified all tests passruff format pyodk tests
andruff check pyodk tests
to lint code