summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-03-08 10:01:59 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-03-08 10:01:59 +0000
commit055c01103de70b1f08321b1dbbcbc4da84821a79 (patch)
treed295102113b9a6dc09fdc993c1d5c8639440cf27 /django
parent244bb7e6012d0cc37557efaee90adb5c7e885306 (diff)
[1.0.x] Fixed #9508 -- Added an appropriate FileField.__hash__ implementation.
Required because we declare a custom __eq__ method. Backport of r9997 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10000 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/db/models/fields/files.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/django/db/models/fields/files.py b/django/db/models/fields/files.py
index f1c7468f48..1ea4415a18 100644
--- a/django/db/models/fields/files.py
+++ b/django/db/models/fields/files.py
@@ -32,6 +32,10 @@ class FieldFile(File):
def __ne__(self, other):
return not self.__eq__(other)
+ def __hash__(self):
+ # Required because we defined a custom __eq__.
+ return hash(self.name)
+
# The standard File contains most of the necessary properties, but
# FieldFiles can be instantiated without a name, so that needs to
# be checked for here.