Fixed #9508 -- Added an appropriate FileField.__hash__ implementation.

Required because we declare a custom __eq__ method.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9997 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2009-03-08 09:59:17 +00:00
parent d01c17e81d
commit 6e415a5f90
2 changed files with 9 additions and 0 deletions

View file

@ -34,6 +34,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.