Ejemplo n.º 1
0
 def add_country(self, country):
     self.meta.setdefault('countries', [])
     country = parse_country(country)
     if country is None:
         return
     if is_country_code(country) and country not in self.meta['countries']:
         self.meta['countries'].append(country)
         self.update_meta()
Ejemplo n.º 2
0
 def _validate(self, value):
     if not is_country_code(value):
         raise ValidationError('Invalid country code.')
Ejemplo n.º 3
0
 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)