Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

211 datastore import bug #239

Merged
merged 3 commits into from
Sep 22, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions iati_datastore/iatilib/codelists/enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ def __init__(self, cls_, name, value, description):
self.value = value
self.description = description

def __hash__(self):
return hash(self.value)

def __eq__(self, other):
if other is None:
return False
return self.value == other.value

def __ne__(self, other):
if other is None:
return True
return self.value != other.value

def __reduce__(self):
"""Allow unpickling to return the symbol
linked to the DeclEnum class."""
Expand Down