diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-08-23 22:15:09 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-12-12 12:23:18 +0100 | 
| commit | 4d6148a4ff633ab641a4dbecb78e0281c88bd1e6 (patch) | |
| tree | 797a5dc84c8a736779b3566479337dec5a88c529 /ishtar_common/models_common.py | |
| parent | 14079cb2b15a6348bd35ad39a7551b731e9c03c9 (diff) | |
| download | Ishtar-4d6148a4ff633ab641a4dbecb78e0281c88bd1e6.tar.bz2 Ishtar-4d6148a4ff633ab641a4dbecb78e0281c88bd1e6.zip  | |
Add geo buffer type: model, admin, forms
Diffstat (limited to 'ishtar_common/models_common.py')
| -rw-r--r-- | ishtar_common/models_common.py | 19 | 
1 files changed, 18 insertions, 1 deletions
diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py index b2cb095e6..238bbeeac 100644 --- a/ishtar_common/models_common.py +++ b/ishtar_common/models_common.py @@ -2079,6 +2079,18 @@ class GeoProviderType(HierarchicalType):          ) +class GeoBufferType(GeneralType): +    order = models.IntegerField(_("Order"), default=10) + +    class Meta: +        verbose_name = _("Geographic - Buffer type") +        verbose_name_plural = _("Geographic - Buffer types") +        ordering = ( +            "order", +            "label", +        ) + +  GEOJSON_POINT_TPL = {      "type": "FeatureCollection",      "features": [ @@ -2115,6 +2127,12 @@ class GeoVectorData(Imported, OwnPerms):          "related_items_archaeological_warehouse_container",      ] +    buffer = models.FloatField( +        _("Buffer"), blank=True, null=True +    ) +    buffer_type = models.ForeignKey(GeoBufferType, blank=True, null=True, +                                    on_delete=models.CASCADE) +    need_update = models.BooleanField(_("Need update"), default=False)      name = models.TextField(_("Name"), default="-")      source_content_type = models.ForeignKey(          ContentType, related_name="content_type_geovectordata", on_delete=models.CASCADE @@ -2177,7 +2195,6 @@ class GeoVectorData(Imported, OwnPerms):      multi_points = models.MultiPointField(_("Multi points"), blank=True, null=True)      multi_line = models.MultiLineStringField(_("Multi lines"), blank=True, null=True)      multi_polygon = models.MultiPolygonField(_("Multi polygons"), blank=True, null=True) -    need_update = models.BooleanField(_("Need update"), default=False)      class Meta:          verbose_name = _("Geographic - Vector data")  | 
