From cc8833037f3313b8cb0a7f66eead01cf110aa7b1 Mon Sep 17 00:00:00 2001 From: relikd Date: Wed, 3 Jul 2024 00:14:42 +0200 Subject: [PATCH] ref: context value "id" --- map_location/fields.py | 1 + map_location/templates/forms/map-location.html | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/map_location/fields.py b/map_location/fields.py index d6248cc..136ac1a 100644 --- a/map_location/fields.py +++ b/map_location/fields.py @@ -28,6 +28,7 @@ class MapLocationWidget(Widget): def get_context(self, name, value, attrs): context = super().get_context(name, value, attrs) + context['id'] = context['widget']['attrs']['id'] context['map_options'] = json.dumps( context['widget']['attrs'].get('options')) return context diff --git a/map_location/templates/forms/map-location.html b/map_location/templates/forms/map-location.html index 715b6a3..7afb189 100644 --- a/map_location/templates/forms/map-location.html +++ b/map_location/templates/forms/map-location.html @@ -1,8 +1,8 @@
- -
- Remove + +
+
\ No newline at end of file