Opened 16 years ago

Closed 16 years ago

Last modified 13 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: dev
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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 Phalip 16 years ago.
Fixed doc bug, and added clarification about the expected format for saving files
r8729.diff (856 bytes ) - added by John Shimek 16 years ago.
Added clarifiction on conent for the File.save method

Download all attachments as: .zip

Change History (9)

comment:1 by Julien Phalip, 16 years ago

milestone: 1.0

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 by Julian Bez, 16 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Julien Phalip, 16 years ago

#8675 was closed as dupe.

comment:4 by Julien Phalip, 16 years ago

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?

by Julien Phalip, 16 years ago

Attachment: 8641.file-doc.diff added

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

by John Shimek, 16 years ago

Attachment: r8729.diff added

Added clarifiction on conent for the File.save method

comment:5 by John Shimek, 16 years ago

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

comment:6 by James Bennett, 16 years ago

Resolution: fixed
Status: newclosed

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

comment:7 by Jacob, 13 years ago

milestone: 1.0

Milestone 1.0 deleted

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