-
Notifications
You must be signed in to change notification settings - Fork 15
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
Use form2request for the HttpRequest.from_form implementation #206
Conversation
@kmike What do you think about implementing a In Formasaurus I’m thinking of using form2request directly, to not depend on web-poet, and return a It’s not a hard conversion to do, so users could do it manually. I just wonder whether or not it is a good idea. My main concerns are that “dataclass” is quite generic, if someone makes up some dataclass-based request data container we may not support it, but I also do not think a |
I don't like "from_dataclass" for the same reason - it assumes a very specific dataclass, the one returned by form2request. What do you think about adding to_... methods to form2request?
It seems it'd solve the issue, and also it'd simplify form2request docs and usage. |
Shall we remove |
Hm, a good question. If we go with to.. methods, It looks redundant indeed, as HttpRequest.from_form(form) is the same as form2request(form).to_poet(). This does make this feature less discoverable for web-poet users though. So, no strong opinion on that. |
Maybe we can address discoverability through docs. |
No description provided.