Ticket #16590: patch.diff

File patch.diff, 619 bytes (added by Taavi Taijala, 13 years ago)

Makes ContentFile behave the same as File with regards to a name attribute

  • django/core/files/base.py

     
    122122    """
    123123    A File-like object that takes just raw content, rather than an actual file.
    124124    """
    125     def __init__(self, content):
     125    def __init__(self, content, name=None):
    126126        content = content or ''
    127         super(ContentFile, self).__init__(StringIO(content))
     127        super(ContentFile, self).__init__(StringIO(content), name=name)
    128128        self.size = len(content)
    129129
    130130    def __str__(self):
Back to Top