Code

Opened 7 years ago

Closed 6 years ago

#6266 closed (fixed)

There should be a specific mention of inclusion of request.FILES in the ModelForm documentation

Reported by: kenneth gonsalves <lawgon@…> Owned by: nobody
Component: Documentation Version: master
Severity: Keywords: ModelForm
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

  1. Add for FileField and ImageField that the syntax should be:

form = YourForm(request.POST,request.FILES,instance=instance)

  1. Specifically state that unless is_valid is called, a form with errors will not be returned for correction.
  1. Specfically state that enctype="multipart/form-data" should be added in the template
  1. Specify how to get the file name displayed in the form when a model with one of these fields is loaded for editing

Attachments (0)

Change History (2)

comment:1 Changed 6 years ago by mtredinnick

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

None of this is specific to ModelForms and, in fact, most of it is already mentioned in the forms documentation. I think the only things needed to resolve this are to add a note to the modelforms docs to mention they are normal forms and people should have read those docs as well and to address the fourth point in this list.

comment:2 Changed 6 years ago by ubernostrum

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

(In [7305]) Fixed #6266: Added note to docs/modelforms.txt pointing out that they're just standard forms and have all the same methods as standard forms

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.