-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ [#2173] Add map tile layer admin configuration
- Loading branch information
1 parent
753691c
commit ebe149b
Showing
5 changed files
with
109 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Generated by Django 4.2.17 on 2024-12-10 09:02 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("config", "0068_update_summary_tags"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="MapTileLayer", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
( | ||
"identifier", | ||
models.SlugField( | ||
help_text="A unique identifier for the tile layer", | ||
unique=True, | ||
verbose_name="identifier", | ||
), | ||
), | ||
( | ||
"url", | ||
models.URLField( | ||
help_text="URL to the tile layer image. Used to define the map style/background the form map components. Example value: https://service.pdok.nl/brt/achtergrondkaart/wmts/v2_0/standaard/EPSG:28992/{z}/{x}/{y}.png", | ||
max_length=255, | ||
verbose_name="tile layer url", | ||
), | ||
), | ||
( | ||
"label", | ||
models.CharField( | ||
help_text="An easily recognizable name for the tile layer, used to identify it.", | ||
max_length=100, | ||
verbose_name="label", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "map tile layer", | ||
"verbose_name_plural": "map tile layers", | ||
"ordering": ("label",), | ||
}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
from .color import RichTextColor | ||
from .config import GlobalConfiguration | ||
from .csp import CSPSetting | ||
from .map import MapTileLayer | ||
from .theme import Theme | ||
|
||
__all__ = [ | ||
"CSPSetting", | ||
"GlobalConfiguration", | ||
"RichTextColor", | ||
"MapTileLayer", | ||
"Theme", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from django.db import models | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
|
||
class MapTileLayer(models.Model): | ||
identifier = models.SlugField( | ||
_("identifier"), | ||
unique=True, | ||
max_length=50, | ||
help_text=_("A unique identifier for the tile layer"), | ||
) | ||
url = models.URLField( | ||
_("tile layer url"), | ||
max_length=255, | ||
help_text=_( | ||
"URL to the tile layer image. " | ||
"Used to define the map style/background the form map components. " | ||
"Example value: https://service.pdok.nl/brt/achtergrondkaart/wmts/v2_0/standaard/EPSG:28992/{z}/{x}/{y}.png" | ||
), | ||
) | ||
label = models.CharField( | ||
_("label"), | ||
max_length=100, | ||
help_text=_( | ||
"An easily recognizable name for the tile layer, used to identify it." | ||
), | ||
) | ||
|
||
class Meta: | ||
verbose_name = _("map tile layer") | ||
verbose_name_plural = _("map tile layers") | ||
ordering = ("label",) | ||
|
||
def __str__(self): | ||
return self.label |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters