def collection_geojson(request, collection_id):
collection = get_object_or_404(Collection, pk=collection_id)
photos = get_list_or_404(collection.photo_set.all())
features = [f.get_geojson() for f in photos]
d = {
'type': 'FeatureCollection',
'features': features
}
return JsonResponse(d)
评论列表
文章目录