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

Validate request.form arguments from HTML post form #40

Open
damianhorna opened this issue Sep 13, 2021 · 1 comment
Open

Validate request.form arguments from HTML post form #40

damianhorna opened this issue Sep 13, 2021 · 1 comment

Comments

@damianhorna
Copy link

Hi,

not sure whether there is an option to validate request.form arguments right now, with this package but it would be a nice-to-have feature :)

For example, to use like this:
@validate(form=SomeModel)

Right now, I am validating request.form simply like this:

    try:
        form = LoginFormModel(**request.form)
    except ValidationError as ve:
        return {"validation_error": ve.errors()}, 400

Or is there any other way around?

Any advice would be much appreciated!

@bauerji
Copy link
Owner

bauerji commented Sep 13, 2021

Hello,

this would indeed be a nice feature. This package does not support forms yet. I will try to find time to implement it. Feel free to submit PR.

Thank you for suggestion!

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

2 participants