Project

General

Profile

Gestion de projet #74068

Chiffrage: disposer des variables de pages dans les URLs geojson des layers

Added by Benjamin Dauvergne about 2 years ago. Updated over 1 year ago.

Status:
Nouveau
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
01 February 2023
Due date:
% Done:

0%

Estimated time:
Patch proposed:
No
Planning:
No
Tags:

Description

Dans le modèle MapLayer, on a geojson_url qui est utilisé dans la méthode get_geojson() (ici sans paramètre context) :

    def get_geojson(self, request, properties=''):
        geojson_url = get_templated_url(self.geojson_url)

Il faudrait déjà prendre un context ici.

Ensuit get_geojson() est appelé dans combo.apps.maps.views.GeojsonView.get de cette manière :

class GeojsonView(View):
    def get(self, request, *args, **kwargs):
        cell = get_object_or_404(Map, pk=kwargs['cell_id'])
        layer = get_object_or_404(cell.layers.all(), kind='geojson', slug=kwargs['layer_slug'])
        if not cell.page.is_visible(request.user) or not cell.is_visible(request):
            return HttpResponseForbidden()
        options = cell.maplayeroptions_set.get(map_layer=layer)
        geojson = layer.get_geojson(request, options.properties)
        content_type = 'application/json'
        return HttpResponse(json.dumps(geojson), content_type=content_type)

Ici je suppose que depuis l'objet cellule il faudrait récupérer la page puis genérer un context et le passer à get_geojson. C'est surtout sur ce dernier point où je n'ai aucune idée du travail à faire.

History

#2

Updated by Benjamin Dauvergne about 2 years ago

  • Tags set to chiffrage
#3

Updated by Benjamin Dauvergne about 2 years ago

  • Assignee set to Emmanuel Cazenave
#4

Updated by Emmanuel Cazenave about 2 years ago

  • Assignee deleted (Emmanuel Cazenave)
#7

Updated by Benjamin Dauvergne almost 2 years ago

  • Assignee set to Lauréline Guérin
#10

Updated by Lauréline Guérin almost 2 years ago

  • Assignee changed from Lauréline Guérin to Benjamin Dauvergne
#13

Updated by Benjamin Dauvergne almost 2 years ago

  • Assignee changed from Benjamin Dauvergne to Lauréline Guérin
#15

Updated by Lauréline Guérin over 1 year ago

  • Assignee deleted (Lauréline Guérin)

Also available in: Atom PDF