diff options
| -rw-r--r-- | ishtar_common/management/commands/import_insee_comm_csv.py | 5 | 
1 files changed, 3 insertions, 2 deletions
| diff --git a/ishtar_common/management/commands/import_insee_comm_csv.py b/ishtar_common/management/commands/import_insee_comm_csv.py index e64fe42bb..d0fccb2fc 100644 --- a/ishtar_common/management/commands/import_insee_comm_csv.py +++ b/ishtar_common/management/commands/import_insee_comm_csv.py @@ -61,7 +61,7 @@ class Command(BaseCommand):                      missing.append((old_insee, row['NomCA']))                      continue                  if q.count() > 1: -                    q = q.filter(year_lt=default_year).order_by('-year') +                    q = q.filter(year__lt=default_year).order_by('-year')                      if not q.count():                          strange.append((old_insee, row['NomCA']))                          continue @@ -74,7 +74,7 @@ class Command(BaseCommand):                                          year=default_year)                  if not q.count():                      nb_created += 1 -                    name = row['NomCN'].upper().strip() +                    name = row['NomCN'].decode('utf-8').upper().strip()                      name = r.sub(r"\2 \1", name).strip()                      new_town = Town.objects.create(name=name, year=default_year,                                                     numero_insee=new_insee) @@ -86,6 +86,7 @@ class Command(BaseCommand):                  old_town.children.add(new_town)                  linked.add(new_town)          nb_limit = 0 +        sys.stdout.write('\nGenerate limits...'.format(nb_created))          for town in linked:              if town.generate_geo():                  nb_limit += 1 | 
