def import_countries(self, country_csv): countries = [] lines = country_csv.split('\n') for line in lines: if len(line.strip()) > 0: fields = line.split(';') country = Country() country.order = int(fields[0]) country.name = fields[1].strip() country.local_name = fields[2].strip() country.put() countries.append(country) return countries
def import_countries(self, country_csv): countries = [] lines = country_csv.split('\n') for line in lines: if len(line.strip()) > 0: fields = line.split(';') country = Country() country.order = int(fields[0]) country.name = fields[1].strip() country.local_name = fields[2].strip() country.put() countries.append(country) return countries;
def task_country_restore(items): for item in items: country = Country(key_name=item['countryId']) country.order = item['order'] country.name = item['name'] country.put()