Re: [Django] #37135: LayerMapping unable to update PointFields with "unique" keyword parameter (was: LayerMapping utility seems unable to import PointFields with "unique" keyword parameter)

2 views
Skip to first unread message

Django

unread,
Jun 3, 2026, 12:01:39 PM (3 days ago) Jun 3
to django-...@googlegroups.com
#37135: LayerMapping unable to update PointFields with "unique" keyword parameter
-------------------------------+------------------------------------
Reporter: Agnès Haasser | Owner: (none)
Type: Bug | Status: new
Component: GIS | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by Jacob Walls):

* stage: Unreviewed => Accepted
* summary:
LayerMapping utility seems unable to import PointFields with "unique"
keyword parameter
=>
LayerMapping unable to update PointFields with "unique" keyword
parameter

Comment:

Thanks, reproduced at 170975c5bdc3fc69b15e46f50df7b48eb9e1115c with this
rough test:

{{{#!diff
diff --git a/tests/gis_tests/layermap/tests.py
b/tests/gis_tests/layermap/tests.py
index c590defbd0..ec8d5dc89b 100644
--- a/tests/gis_tests/layermap/tests.py
+++ b/tests/gis_tests/layermap/tests.py
@@ -102,6 +102,14 @@ class LayerMapTest(TestCase):
lm.save()
self.assertEqual(City.objects.count(), 3)

+ def test_layermap_unique_update(self):
+ lm = LayerMapping(City, city_shp, city_mapping, unique="point")
+ lm.save()
+ # Update.
+ lm.save()
+
+ # some assertion about the correct result...
+
def test_layermap_strict(self):
"Testing the `strict` keyword, and import of a LineString
shapefile."
# When the `strict` keyword is set an error encountered will
force
}}}

Would you like submit a PR?
--
Ticket URL: <https://code.djangoproject.com/ticket/37135#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Reply all
Reply to author
Forward
0 new messages