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

Add support for multiple file validation #338

Closed
wants to merge 0 commits into from

Conversation

greyli
Copy link
Member

@greyli greyli commented Jun 4, 2018

Add MultipleFileField, FilesRequired, FilesAllowed to support multiple files validation.

Closes #337

@greyli greyli mentioned this pull request Jun 4, 2018
@codecov-io
Copy link

codecov-io commented Jun 4, 2018

Codecov Report

Merging #338 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #338      +/-   ##
==========================================
+ Coverage   99.67%   99.69%   +0.02%     
==========================================
  Files          18       18              
  Lines         911      986      +75     
  Branches       74       82       +8     
==========================================
+ Hits          908      983      +75     
  Misses          3        3
Impacted Files Coverage Δ
tests/test_file.py 100% <100%> (ø) ⬆️
flask_wtf/file.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 73e8c58...7188dd9. Read the comment docs.

@davidism
Copy link
Member

davidism commented Jun 4, 2018

I experimented with this back when I made the WTForms PR, I'm trying to remember the design decisions I made.

I think that while the fields were separate so it was clear what was intended, I was trying to make the validators work for both single and multiple files (rather than adding extra validators or a multiple=True flag). Do you or @lepture agree with that?

Also might be interesting to add a test of the Length validator on the multiple field.

@greyli
Copy link
Member Author

greyli commented Jun 4, 2018

Sounds good to me.

@theomega
Copy link

I'd love to see this merged. Anything I can help with?

@codecov-commenter
Copy link

codecov-commenter commented Sep 17, 2020

Codecov Report

Merging #338 into master will decrease coverage by 1.33%.
The diff coverage is 81.01%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #338      +/-   ##
==========================================
- Coverage   97.97%   96.63%   -1.34%     
==========================================
  Files          18       18              
  Lines         936     1011      +75     
  Branches       73       81       +8     
==========================================
+ Hits          917      977      +60     
- Misses         17       31      +14     
- Partials        2        3       +1     
Impacted Files Coverage Δ
tests/test_file.py 78.18% <76.00%> (-2.78%) ⬇️
flask_wtf/file.py 90.62% <89.65%> (-1.05%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d41f3bc...beb8623. Read the comment docs.

@misilot
Copy link

misilot commented Nov 7, 2022

Any chance of this being merged? :)

@PanderMusubi
Copy link

Any chance of this being merged? :)

Hoping the same. @azmeuk can you review this please?

@greyli
Copy link
Member Author

greyli commented Nov 21, 2022

This PR may not be merged.

I was planning to implement what David recommended as an alternative to this PR in January, but I was too busy with work. Maybe I will have time to make another PR next month. BTW, I'm also happy to review a PR!

@greyli
Copy link
Member Author

greyli commented Mar 8, 2023

Hi guys, I finally re-implemented this in #556. With the new PR, the FileRequired, FileAllowed, and FileSize can be used for both single or multiple files.

@greyli greyli deleted the multiple-file-validation branch March 8, 2023 14:19
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Handle multiple files
7 participants