Exemple #1
0
 def parks(self, request, *args, **kwargs):
     instance = self.get_object()
     qs = instance.parks
     qs.order_by('id')
     serializer = ParkSerializer(qs,
                                 context={'request': request},
                                 many=True)
     return Response(serializer.data)
Exemple #2
0
class ProposalParkSerializer(serializers.ModelSerializer):
    park=ParkSerializer()
    land_activities=ProposalParkActivitySerializer(many=True)
    #marine_activities=ProposalParkActivitySerializer(many=True)
    zones=ProposalParkZoneSerializer(many=True)
    access_types=ProposalParkAccessSerializer(many=True)
    class Meta:
        model = ProposalPark
        fields = '__all__'
Exemple #3
0
 def land_parks(self, request, *args, **kwargs):
     qs = self.get_queryset().filter(park_type='land')
     serializer = ParkSerializer(qs,
                                 context={'request': request},
                                 many=True)
     return Response(serializer.data)