1
0
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:
Jacob Kaplan-Moss
2009-01-16 21:48:37 +00:00
parent 79138a6106
commit 6332ad4804
3 changed files with 46 additions and 7 deletions

View File

@@ -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)