#26367: Assess if FieldFile can work with stdlib File instead of requiring
Django's
File
--------------------------------------+------------------------------------
Reporter: cristianocca | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: File uploads/storage | Version: 1.9
Severity: Normal | Resolution:
Keywords: file storage | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Comment (by cristianocca):
Looks like something as simple as
{{{
if not isinstance(content, File):
content = File(content)
}}}
at the FieldFile.save method doesn't break anything and would remove the
requierement from the docs ''"Note that the content argument should be an
instance of django.core.files.File, not Python’s built-in file object. You
can construct a File from an existing Python file object like this:"''
making it simpler to save a file.
--
Ticket URL: <https://code.djangoproject.com/ticket/26367#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/070.042c25d7b45f9d443bd674dcf29a644b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.