From 4164ea2109d6ed20c1334c3fec878ad88798e896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=BE=D1=88=D0=BA=D0=B8=D0=BD=20=D0=A1=D0=B5=D1=80?= =?UTF-8?q?=D0=B3=D0=B5=D0=B9?= Date: Wed, 3 Dec 2025 14:18:09 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D1=84=D0=B8=D0=BA=D1=81=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=B1=D0=B0=D0=B3=20=D1=81=20=D0=BA=D0=BE=D0=BE=D1=80?= =?UTF-8?q?=D0=B4=D0=B8=D0=BD=D0=B0=D1=82=D0=B0=D0=BC=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbapp/mainapp/forms.py | 9 ++------- .../mainapp/components/_messages.html | 17 +++++++++------- dbapp/mainapp/views/data_import.py | 20 ++++++++++++++++++- 3 files changed, 31 insertions(+), 15 deletions(-) diff --git a/dbapp/mainapp/forms.py b/dbapp/mainapp/forms.py index 9755e0f..7862fd3 100644 --- a/dbapp/mainapp/forms.py +++ b/dbapp/mainapp/forms.py @@ -534,13 +534,8 @@ class SourceForm(forms.ModelForm): instance = super().save(commit=False) - # Обработка coords_average - avg_lat = self.cleaned_data.get("average_latitude") - avg_lng = self.cleaned_data.get("average_longitude") - if avg_lat is not None and avg_lng is not None: - instance.coords_average = Point(avg_lng, avg_lat, srid=4326) - else: - instance.coords_average = None + # coords_average НЕ обрабатываем здесь - это поле управляется только программно + # (через _recalculate_average_coords в модели Source) # Обработка coords_kupsat kup_lat = self.cleaned_data.get("kupsat_latitude") diff --git a/dbapp/mainapp/templates/mainapp/components/_messages.html b/dbapp/mainapp/templates/mainapp/components/_messages.html index 5a15cb4..0a56283 100644 --- a/dbapp/mainapp/templates/mainapp/components/_messages.html +++ b/dbapp/mainapp/templates/mainapp/components/_messages.html @@ -2,29 +2,32 @@ Переиспользуемый компонент для отображения сообщений Django Использование: {% include 'mainapp/components/_messages.html' %} + +Для отключения автоскрытия добавьте extra_tags='persistent': + messages.success(request, "Сообщение", extra_tags='persistent') {% endcomment %} {% if messages %}
{% for message in messages %} -