diff --git a/src/agenda_culturel/migrations/0081_auto_20241010_2235.py b/src/agenda_culturel/migrations/0081_auto_20241010_2235.py index 1f6e475..fcc4fd3 100644 --- a/src/agenda_culturel/migrations/0081_auto_20241010_2235.py +++ b/src/agenda_culturel/migrations/0081_auto_20241010_2235.py @@ -1,11 +1,11 @@ # Generated by Django 4.2.9 on 2024-10-10 20:35 from django.db import migrations -from agenda_culturel.models import Place from django.contrib.gis.geos import Point def change_coord_format(apps, schema_editor): - places = Place.objects.all() + Place = apps.get_model("agenda_culturel", "Place") + places = Place.objects.values("location", "location_pt").all() for p in places: l = p.location.split(',') @@ -13,14 +13,15 @@ def change_coord_format(apps, schema_editor): p.location_pt = Point(float(l[1]), float(l[0])) else: p.location_pt = Point(3.08333, 45.783329) - p.save() + p.save(update_fields=["location_pt"]) def reverse_coord_format(apps, schema_editor): - places = Place.objects.all() + Place = apps.get_model("agenda_culturel", "Place") + places = Place.objects.values("location", "location_pt").all() for p in places: p.location = ','.join([p.location_pt[1], p.location_pt[0]]) - p.save() + p.save(update_fields=["location"]) diff --git a/src/agenda_culturel/views.py b/src/agenda_culturel/views.py index 27eed27..4ced3d8 100644 --- a/src/agenda_culturel/views.py +++ b/src/agenda_culturel/views.py @@ -721,7 +721,6 @@ def export_event_ical(request, year, month, day, pk): return response - def export_ical(request): now = date.today()