From b2a53fd828727161f1093bcd906a41b4809f3f00 Mon Sep 17 00:00:00 2001 From: Konsta Vesterinen Date: Wed, 15 Apr 2015 19:31:47 +0300 Subject: [PATCH] Add __hash__ for Country --- sqlalchemy_utils/primitives/country.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sqlalchemy_utils/primitives/country.py b/sqlalchemy_utils/primitives/country.py index d874182..bae9ea5 100644 --- a/sqlalchemy_utils/primitives/country.py +++ b/sqlalchemy_utils/primitives/country.py @@ -85,6 +85,9 @@ class Country(object): else: return NotImplemented + def __hash__(self): + return hash(self.code) + def __ne__(self, other): return not (self == other)