From 7c4b47624e9a1e60f9da89ffcd93b6f35af75d79 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Thu, 12 Jan 2023 18:21:55 +0100 Subject: fix layer types not being recognized Since we aliased the field layer_type to layer, we would need to use type=... to set it. However, it is a bit confusing if we access it as TileLayerConfig.layer_type, but set it with type=..., therefore let's just turn on allow_population_by_field_name. This option lets us use layer_type=... to set the field when initializing the object. --- fietsboek/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fietsboek/config.py b/fietsboek/config.py index 068382e..54faf39 100644 --- a/fietsboek/config.py +++ b/fietsboek/config.py @@ -105,7 +105,7 @@ class PyramidList(list): return settings.aslist(value) -class TileLayerConfig(BaseModel): +class TileLayerConfig(BaseModel, allow_population_by_field_name=True): """Object representing a single tile layer.""" layer_id: str -- cgit v1.2.3