Opened 7 years ago

Closed 6 years ago

Last modified 4 years ago

#8857 closed (fixed)

Forms documentation doesn't describe how to handle uploads

Reported by: kylefox Owned by: jacob
Component: Documentation Version: master
Severity: Keywords: docs, forms, files, uploads
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The general form documentation Working with Forms does not mention how to handle forms that include files. There is no mention of passing request.FILES into the Form's constructor, nor of the required enctype="multipart/form-data" attribute of the <form> tag.

However, the "next" article Creating forms from models refers back to Working with Forms for handling file uploads.:

" ... a form requires multipart file upload (and hence whether request.FILES must be passed to the form), etc. See Working with Forms for more information."

The documentation for handling form uploads in buried in the Forms API. It would be very useful to have this info (or a link to it) in the introductory "Working with forms" document. At the very least, the reference to "Working with forms" from "Creating forms from models" needs to be removed, since the information is not contained there.

Attachments (1)

modelforms_docs_diff.patch (642 bytes) - added by prairiedogg 6 years ago.
Changed reference link from working with forms to binding-uploaded-files

Download all attachments as: .zip

Change History (9)

comment:1 Changed 7 years ago by anonymous

  • milestone set to 1.0
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 7 years ago by jacob

  • milestone changed from 1.0 to post-1.0

comment:3 Changed 7 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:4 Changed 7 years ago by jacob

  • milestone set to 1.1
  • Triage Stage changed from Unreviewed to Accepted

comment:5 Changed 6 years ago by jacob

  • Owner changed from nobody to jacob
  • Status changed from new to assigned

Changed 6 years ago by prairiedogg

Changed reference link from working with forms to binding-uploaded-files

comment:6 Changed 6 years ago by prairiedogg

Added a patch to modelforms docs that changes the link in the "working with forms" document in accordance with what kylefox described as the "bare minimum" to resolve this ticket.

comment:7 Changed 6 years ago by Alex

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in r10837.

comment:8 Changed 4 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

Note: See TracTickets for help on using tickets.
Back to Top