Opened 7 years ago

Closed 6 years ago

Last modified 3 years ago

#8641 closed (fixed)

File.save documentation does not mention that contents must be a Django file object

Reported by: pauldwaite Owned by: nobody
Component: Documentation Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The documentation for the revised FileField (http://www.djangoproject.com/documentation/files/) documents the replacement for save_FOO_file, File.save(name, content, save=True).

However, as far as I can tell from testing Beta 2, the content to be saved can no longer be a string. It must be an instance of the new Django File class (or at least an object that has a chunks attribute).

The documentation makes no mention of this.

Attachments (2)

8641.file-doc.diff (1.3 KB) - added by julien 7 years ago.
Fixed doc bug, and added clarification about the expected format for saving files
r8729.diff (856 bytes) - added by varikin 7 years ago.
Added clarifiction on conent for the File.save method

Download all attachments as: .zip

Change History (9)

comment:1 Changed 7 years ago by julien

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

This request for modifying the docs was, I think, approved by Marty Alchin in : http://groups.google.com/group/django-users/browse_thread/thread/d7e9263cd2c5587e

Bumping this to 1.0 as it is likely a common trap for users.

comment:2 Changed 7 years ago by julianb

  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 7 years ago by julien

#8675 was closed as dupe.

comment:4 Changed 7 years ago by julien

  • Has patch set

I've attached a patch to fix the bug in the doc and to add some clarification about the need to use a Django File object for storage saving. Can you think of any other place where more clarification is required?

Changed 7 years ago by julien

Fixed doc bug, and added clarification about the expected format for saving files

Changed 7 years ago by varikin

Added clarifiction on conent for the File.save method

comment:5 Changed 7 years ago by varikin

I think both patches can be used since they clarify different sections of the docs.

comment:6 Changed 6 years ago by ubernostrum

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

(In [8759]) Fixed #8641: Documented the fact that file-saving methods must receive a File instance

comment:7 Changed 3 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

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