Hi there,

First off, thanks for a great package guys :)

I noticed it is currently only possible to register one url with an action. 
This makes registering actions with multiple potential routes a bit ugly:

Let say I have the following method:

class FooViewSet(ModelViewSet):

    def bar(self, request, kwarg1=None, kwargs2=None):
        pass

I would ideally like to register two urls:
foo/bar/kwargs1/
foo/bar/kwargs1/kwargs2/

It is possible to solve this with regex atm but it is not pretty:

    @action(methods=['get'], 
url_path='bar/(?P<kwarg1>[^\.]+)(/P<kwarg2>[^\.]+)?, detail=False)
    def bar(self, request, kwarg1=None, kwargs2=None):
        pass

A better way would allow for multiple decorators or multiple urls to be 
passed.

Not a big issue (since there is a workable solution) but I thought I'd post 
it anyways.

PJ


-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to