def sync_trek_signages(self, lang, trek, zipfile=None): params = {'format': 'geojson'} view = TrekSignageViewSet.as_view({'get': 'list'}) name = os.path.join('api', lang, 'treks', str(trek.pk), 'signages.geojson') self.sync_view(lang, view, name, params=params, zipfile=zipfile, pk=trek.pk)
from django.conf.urls import url from mapentity.registry import registry from . import models from geotrek.trekking.views import TrekInfrastructureViewSet, TrekSignageViewSet urlpatterns = registry.register(models.Infrastructure) urlpatterns += registry.register(models.Signage) urlpatterns += [ url(r'^api/(?P<lang>\w\w)/treks/(?P<pk>\d+)/infrastructures\.geojson$', TrekInfrastructureViewSet.as_view({'get': 'list'}), name="trek_infrastructure_geojson"), url(r'^api/(?P<lang>\w\w)/treks/(?P<pk>\d+)/signages\.geojson$', TrekSignageViewSet.as_view({'get': 'list'}), name="trek_signage_geojson"), ]
from django.conf import settings from django.urls import path, register_converter from mapentity.registry import registry from . import models from geotrek.trekking.views import TrekSignageViewSet from geotrek.common.urls import LangConverter register_converter(LangConverter, 'lang') app_name = 'signage' urlpatterns = registry.register(models.Signage, menu=settings.SIGNAGE_MODEL_ENABLED) urlpatterns += registry.register(models.Blade, menu=False) urlpatterns += [ path('api/<lang:lang>/treks/<int:pk>/signages.geojson', TrekSignageViewSet.as_view({'get': 'list'}), name="trek_signage_geojson"), ]