mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #10044: You can now assign directly to file fields (instance.filefield = somefile). Thanks, Marty Alchin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9766 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -32,6 +32,8 @@ class File(object):
|
||||
return self.size
|
||||
|
||||
def _get_name(self):
|
||||
if not hasattr(self, '_name'):
|
||||
raise ValueError("This operation requires the file to have a name.")
|
||||
return self._name
|
||||
name = property(_get_name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user