1
0
mirror of https://github.com/django/django.git synced 2025-10-25 14:46:09 +00:00

Use classmethod as a decorator.

This commit is contained in:
xuxiang
2013-11-20 10:02:30 +08:00
committed by Simon Charette
parent 73b3c257e3
commit 4cfe6ba6a3
4 changed files with 5 additions and 5 deletions

View File

@@ -117,6 +117,7 @@ class SimpleUploadedFile(InMemoryUploadedFile):
super(SimpleUploadedFile, self).__init__(BytesIO(content), None, name,
content_type, len(content), None, None)
@classmethod
def from_dict(cls, file_dict):
"""
Creates a SimpleUploadedFile object from
@@ -128,4 +129,3 @@ class SimpleUploadedFile(InMemoryUploadedFile):
return cls(file_dict['filename'],
file_dict['content'],
file_dict.get('content-type', 'text/plain'))
from_dict = classmethod(from_dict)