diff --git a/gratipay/models/country.py b/gratipay/models/country.py index 6b6dc5e668..646a8861e7 100644 --- a/gratipay/models/country.py +++ b/gratipay/models/country.py @@ -16,3 +16,7 @@ class Country(Model): """ typname = 'countries' + + @classmethod + def from_code2(cls, code2): + return cls.db.one("SELECT countries.*::countries FROM countries WHERE code2=%s", (code2,))