def clean(self, value, record, config): value = super(CountryProperty, self).clean(value, record, config) return parse_country(value) or value
def normalize_value(self, value): return parse_country(value)
def add_country(self, country): country = parse_country(country) if country is None: return if is_country_code(country) and country not in self._countries: self._countries.append(country)