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

Get form multivalue using methods like getlist #44

Closed
Tishka17 opened this issue Nov 12, 2019 · 3 comments
Closed

Get form multivalue using methods like getlist #44

Tishka17 opened this issue Nov 12, 2019 · 3 comments

Comments

@Tishka17
Copy link
Member

In werkzeug MultiDict allows to use getlist to get multiple values for single name in form data.

This could be useful for filing dataclass List field

@Tishka17
Copy link
Member Author

Tishka17 commented Nov 12, 2019

Можно запилить мапу вида

класс -> геттер и геттер секвенса.

dict: (operator.getitem, operator.getitem),
QueryDict: (QueryDict.get, QueryDict.getlist),
MultidictDict: (MultidictDict.get, MultidictDict.getlist),
Sequence: (operator.getitem, operator.getitem)

For unsupported classes it can be even getattr method

@Tishka17
Copy link
Member Author

Осторожно: itemgetter медленнее чем квадратные скобки

@zhPavel
Copy link
Member

zhPavel commented Jun 8, 2024

This issue is generalized by #287

@zhPavel zhPavel closed this as completed Jun 8, 2024
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