Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Add a helper to Country; should go upstream prolly
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed May 10, 2016
1 parent 8647b88 commit 495f3b6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gratipay/models/country.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,))

0 comments on commit 495f3b6

Please sign in to comment.