Esempio n. 1
0
    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
Esempio n. 2
0
    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;
Esempio n. 3
0
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()
Esempio n. 4
0
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()