mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #16590 -- Accepted a 'name' argument in the constructor of ContentFile, for consistency with File.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17298 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -122,9 +122,9 @@ class ContentFile(File):
|
||||
"""
|
||||
A File-like object that takes just raw content, rather than an actual file.
|
||||
"""
|
||||
def __init__(self, content):
|
||||
def __init__(self, content, name=None):
|
||||
content = content or ''
|
||||
super(ContentFile, self).__init__(StringIO(content))
|
||||
super(ContentFile, self).__init__(StringIO(content), name=name)
|
||||
self.size = len(content)
|
||||
|
||||
def __str__(self):
|
||||
|
||||
Reference in New Issue
Block a user