Add request.FILES to wagtailforms form creation
See original GitHub issueI would like to request we add request.FILES to the creation of custom forms.
Reasoning: It makes it much easier to extend the forms with features like file and image uploads, without having to override the whole serve
method.
File: wagtail/wagtailforms/models.py Line 240 https://github.com/wagtail/wagtail/blob/master/wagtail/wagtailforms/models.py#L240
Current
form = self.get_form(request.POST, page=self, user=request.user)
Suggested
form = self.get_form(request.POST, request.FILES, page=self, user=request.user)
I am happy to put through a pull request and check tests against this change, the request.FILES object will be empty when there are no files so it should not affect existing code.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
How can I add an Upload File field to a Wagtail Form?
Hey, I have recently revised the original post about adding image uploads and it works on Wagtail 2.10 - dev.to/lb/image-uploads-in-wagtail- ...
Read more >How to create file upload forms for your clients (a step-by-step ...
Step 2: build a new form request. In the home screen, select Add New Request. This takes you to the Request Builder screen....
Read more >Image Uploads in Wagtail Forms - Posts by LB
We are adding request.FILES to the arguments between request.POST and page=self . The detailed reason for this is that Django handles files sent ......
Read more >Image Uploads in Wagtail Forms - DEV Community
Adding Image Upload Fields to Forms in Wagtail ... In your models file you will now need to create an extended form builder...
Read more >how to add file upload field in wagtail form ? - Google Groups
I am trying to make something like simple google forms application in wagtail, as I know that there are almost everything is available...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@BertrandBordage FWIW here is my blog post - slide me an email if you have some thoughts on this implementation. https://posts-by.lb.ee/image-uploads-in-wagtail-forms-3121c9b35d27
OK, then I’m fine with merging your pull request.