Skip to content

Conversation

@lindsay-stevens
Copy link
Contributor

Closes #800

Why is this the best possible solution? Were any other approaches considered?

Initial implementation that passes existing relevant tests and a handful of new ones but still needs:

  • validations to be added
  • error messages tidied up
  • much more + thorough tests
  • more docstrings / comments
  • resolve todo's
  • probably some restructuring to improve readability / maintainability e.g.
    • replace mysterious dict/tuple/etc with types (with class methods etc)
    • redundant data processing / call paths

What are the regression risks?

New feature but main regression risk is breaking forms for the old entity specs

Does this change require updates to documentation? If so, please file an issue here and include the link below.

Yes, there's a spec doc update already but XLSForm side not documented yet

Before submitting this PR, please make sure you have:

  • included test cases for core behavior and edge cases in tests
  • run python -m unittest and verified all tests pass
  • run ruff format pyxform tests and ruff check pyxform tests to lint code
  • verified that any code or assets from external sources are properly credited in comments

- survey_element.py: add "type" (if available) to the repr for debugging
- entity_declaration.py: add missing "type" field which appears in the
  dict prepared by entity_parsing.py, and in general set that type
  argument by default
- survey.py: similar to the above add type field to init signature, and
  remove unicode/repr in favour of survey_element implementation
- works the same but could allow builder.py to be compatible with
  Survey/SurveyElement tree as well as the workbook_to_json output dict
- allowed to put entities in repeats (v1)
- allowed to declare more than one entity (v2)
- pyxform places the entity instead of user-specified (v2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow declaring that multiple Entities should be created/updated

1 participant