diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-10-03 10:08:55 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-10-03 10:08:55 +0200 |
commit | 8fcaa54363acc8f77beded50e805ca432e8efa77 (patch) | |
tree | bb604840f122d96da15db22bc76b5e8b32adc7e8 /scripts | |
parent | 3dad3b6976ae9801caf6b0e2397e5efb5166d6d5 (diff) | |
download | Ishtar-8fcaa54363acc8f77beded50e805ca432e8efa77.tar.bz2 Ishtar-8fcaa54363acc8f77beded50e805ca432e8efa77.zip |
Maintenance script for de-dup towns (2)
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/2016-09-29-clean-dup-towns-pdl.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/scripts/2016-09-29-clean-dup-towns-pdl.py b/scripts/2016-09-29-clean-dup-towns-pdl.py index f454a7cac..ebacb2fdf 100644 --- a/scripts/2016-09-29-clean-dup-towns-pdl.py +++ b/scripts/2016-09-29-clean-dup-towns-pdl.py @@ -1,4 +1,4 @@ -from ishtar_common import Town +from ishtar_common.models import Town dup_nb = 0 @@ -37,10 +37,15 @@ strange = [] for town in Town.objects.exclude(pk__in=pdl): if (town.file_main.count() or town.parcels.count() or town.file.count() or town.operations.count()): - strange.append(town) + strange.append((town, town.file_main.count(), town.parcels.count(), + town.file.count(), town.operations.count())) continue town.delete() + print('* Problems with:') for t in strange: - print(t) + print("{}: \n\t* {} ville principale dossier\n\t* {} parcelles\n\t* {} " + "villes pour" + " dossier\n\t* {} ville pour operation".format(t[0], t[1], t[2], + t[3], t[4])) |