Django-alt

Latest version: v0.74

Safety actively analyzes 629855 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 3

0.50

- In addition to individual field validation, it is now possible to define
own methods on the `Validator` that are automatically called upon create/update.
The rules of custom function definition on `Validator` is as follows:
- `field_<field_name>` if defined, these functions are called for each serializer field.
These functions accept one parameter &ndash; `value` (the given field's value).
- `check_*` any defined function starting with `check_` is called automatically in an
alphabetical order after `base` validation. These functions accept one
parameter &ndash; `attrs` dict.
- It is also worthwhile to know that `check_*` functions **should not** mutate the
attrs object

0.40

- Option to validate individual fields. This allows even more separation
of concerns. Now serializer calls `check_<field>` on the model validator for each
`<field>` defined on the serializer (only if its value was in `attrs`).
This validation happens *after* `base` validation is completed. Note that at this stage
the `attrs` dict is **not** mutated.

0.30

- Added `fields_from_url` parameter to endpoint `config`. Until now
serializer fields were only specified in request body. This allows a structured and
straightforward way to retrieve their values from URL parameters.
- Added `recipes.md` document that aims to provide short self&ndash;explanatory
code excerpts.
useful for quick scenario look-up (think *cheat&ndash;sheet*).

0.24

- Added shortcuts `if_all_in` and `if_any_in`.

0.23

- Added `coal` null-coalescing shortcut.
- Updated `validate` attrs replacement behaviour.

0.22

- Added `serializer` back-reference to abstract validator.
- Updated `validate` method to replace `attrs` reference, if a new object is returned from validator methods.
- Fixed appending dot after an exclamation mark in `make_error` function.

Page 2 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.