diff --git a/importers/country.py b/importers/country.py index 5021048..1141d35 100644 --- a/importers/country.py +++ b/importers/country.py @@ -9,6 +9,7 @@ def run(): ('code', 'code'), ('name_en', 'name_en'), ('name_fr', 'name_fr'), + ('@status', 'status'), ] r = fetch(url) reader = csv.DictReader(r.iter_lines(decode_unicode=True)) @@ -16,11 +17,13 @@ def run(): 'code': x['code'], 'name_en': x['name_en'], 'name_fr': x['name_fr'], + 'status': 'active' if x.get('active') == 'True' else 'withdrawn', } for x in reader] countries.append({ 'code': 'XK', 'name_en': 'Kosovo', 'name_fr': '', + 'status': 'active' }) countries = sorted(countries, key=lambda x: x['name_en']) Importer('Country', 'countries', lookup, source_data=countries)