Skip to content

[Enhancement]: Passing data through form fields changes their requiredness #9

@acidjunk

Description

@acidjunk

Currently on the python side we misuse a fields default value: for injecting the data on Form that are used to edit stuff.
This has a side effect: all form fields that have data, have a default -> so are not required anymore.

Currently we work around this with extra validators, which is error prone and leads to code duplication in cases where you have a Create and Edit Form.

Solution direction:

  1. it would be nice to embed the form data in the JSON scheme
  2. check if it possible to use the "uniforms" as a nested dict in the form field property: to provide the data (see screen, which shows an extra "value" key.)
  3. if 2 is not possible: try to return the data inside the JSON scheme on another location: frontend will need changes to populate the fields

Schermafbeelding 2023-05-04 om 13 28 08

Questions:

  • what to do with edit form when no data can be found for a field; but a default does exist on the form definition?

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions