1
0
mirror of https://github.com/django/django.git synced 2025-07-17 16:19:12 +00:00

[3.1.x] Refs #32230 -- Fixed LayerMapping example in GeoDjango tutorial.

LayerMapping.data_source doesn't support pathlib.Path().

Regression in 26554cf5d1e96db10d0d5f4b69683a22fb82fdf8.

Follow up to e46ca51c249677c52e04db28fc0c60ae1948b3b2.
This commit is contained in:
Mariusz Felisiak 2020-11-28 09:22:34 +01:00 committed by GitHub
parent 3a70c362ec
commit 2ab8b5f4f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -453,7 +453,7 @@ with the following code::
world_shp = Path(__file__).resolve().parent / 'data' / 'TM_WORLD_BORDERS-0.3.shp' world_shp = Path(__file__).resolve().parent / 'data' / 'TM_WORLD_BORDERS-0.3.shp'
def run(verbose=True): def run(verbose=True):
lm = LayerMapping(WorldBorder, world_shp, world_mapping, transform=False) lm = LayerMapping(WorldBorder, str(world_shp), world_mapping, transform=False)
lm.save(strict=True, verbose=verbose) lm.save(strict=True, verbose=verbose)
A few notes about what's going on: A few notes about what's going on: