﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
29607	Add doc examples of handling files and their lifecycles with FileField/models.	Thomas Grainger	Rahul Manelkar	"Currently the documentation on how to do various file operations isn't documented eg:

* I've got some file contents as a string and a model instance with a file field, I want to set the content of the instances' file to the value of the string
* I've got a file like object and I'd like to transform it line by line then append it to the file of a model field.

In all cases:

* properly managing the file lifetime open/close so that it works on non-reference counting python implementations like PyPy
* cleaning up the FieldFile so that other code that accesses the file still works
* never using up too much memory by reading a whole file into memory

Also, are some methods like: `instance.file.read()` without an associated `with instance.file.open()` always dangerous - and should they be deprecated?

Should the Django File instances operate more like `pathlib.PurePath` ? in that `.read()` opens the file, reads the content then closes it, and `.write()` opens the file, writes the file, then closes it."	Cleanup/optimization	assigned	Documentation	dev	Normal			Chris Adams	Accepted	1	0	0	1	0	0
