#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)
Change History (9)
comment:1 by , 17 years ago
| milestone: | → 1.0 |
|---|
comment:2 by , 17 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:4 by , 17 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 , 17 years ago
| Attachment: | 8641.file-doc.diff added |
|---|
Fixed doc bug, and added clarification about the expected format for saving files
by , 17 years ago
| Attachment: | r8729.diff added |
|---|
Added clarifiction on conent for the File.save method
comment:5 by , 17 years ago
I think both patches can be used since they clarify different sections of the docs.
comment:6 by , 17 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
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.