def get_or_create(self, val, **kwargs): from jflow.db.geo import currency c = currency(val) if c: return c.code else: raise ValueError('Currency %s not recognized' % val)
def currency(self, val): ccy = currency(val) if ccy == None: raise ValueError else: return ccy