summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
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.