blob: 04909f3ee6cbc1372dc18db6ab05807ed92343bf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
from django.db import migrations
from ishtar_common.utils_migrations import update_import_key
def update_importkey(apps, __):
updated = 0
GeoVectorData = apps.get_model("ishtar_common", "geovectordata")
for data in GeoVectorData.objects.all():
updated += 1 if update_import_key(data) else 0
if updated:
print()
print(f"* {updated} GeoVectorData import_key updated")
class Migration(migrations.Migration):
dependencies = [
('ishtar_common', '0267_gis_importchunk'),
]
operations = [
migrations.RunPython(update_importkey)
]
|