I was expecting the same thing this morning. I think it's really useful.

On 2/1/17, Nadav Kehati <na...@nadalia.com> wrote:
> I am trying to add an action-link to the object's browsable API:
>
> class MyModelSerializer(serializers.HyperlinkedModelSerializer):
>     class Meta:
>         model = MyModel
>         fields = '__all__'
>
>
> class MyModelViewSet(viewsets.ModelViewSet):
>
>   queryset = MyModel.objects.all()
>   serializer_class = MyModelSerializer
>
>
>   @detail_route(methods=['get', 'post'])
>   def some_action(self, request, pk=None):
>
>     pass
>
>
>
> The endpoint /mymodel/{id}/some_action is automatically created by the
> above and *routes correctly*, but browsing to /mymodel/{id}/ does not
> display a hyperlink to some_action.
>
> How can I display the @detail_route action in the browsable API as a url
> link?
> (per my understanding this is support by
> https://github.com/tomchristie/django-rest-framework/issues/2062. Am I
> mistaken?)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-rest-framework+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to