django-adapters icon indicating copy to clipboard operation
django-adapters copied to clipboard

Prototype validation tree

Open mjtamlyn opened this issue 8 years ago • 2 comments

Create a prototype of the validation tree, allowing similar chaining of validation/cleaning functions similar to what Naval can do (see #21).

mjtamlyn avatar Apr 11 '16 20:04 mjtamlyn

Here is a list of what should be possible:

  • field validation (e.g.: username must not contain special characters)
  • field "cleaning" (e.g.: unicode-normalize username)
  • cross field validation (e.g.: email must contain username)
  • specifying dependencies (e.g. first normalize username, then check for special chars)

It would also be nice to be able to continue the validation as far as possible even if one step failed, e.g. if the username contained special characters, the date of birth should still be checked.

To make all of this possible I think using a DAG (Directed Acyclic Graph) is the way to go, compared to Naval's more naive list of validators.

MoritzS avatar Apr 14 '16 10:04 MoritzS

I think Naval's list of validators can be turned into a DAG without much difficulty, so that might still be a good UI for it.

LilyFoote avatar Apr 14 '16 11:04 LilyFoote