Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a working example for (or document) validation in mappers #80

Open
m-thielen opened this issue Feb 6, 2021 · 0 comments
Open

Comments

@m-thielen
Copy link

m-thielen commented Feb 6, 2021

The examples in the docs about validation in mappers are not correct - at least, exceptions are raised when calling e.g. put_invalid in the way that is is shown in the docs.
It is not clear what the errors parameter for put_invalid should actually be.

This is the example code I'm referring to:

[...]
         try:
             data >> profile_mapper  # This is shorthand for _patch
         except ValidationError as e:
             errors.update(dict(e))

         if errors:
             return self.patch_invalid(errors)

https://django-nap.readthedocs.io/en/latest/rest/index.html#example-updating-two-objects

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

No branches or pull requests

1 participant