It didn't work exactly the way I was hoping. I can't just add 
`lookup_value_regex` to the `@detail_route`, it needs to be part of the 

    lookup_field = 'blah'
    lookup_value_regex = 'pattern'

if I don't have these in my viewset then I get an error:

>TypeError:MyViewSet() received an invalid keyword 'lookup_value_regex'
>   Fiel "~/myproject/myproject/myapp/", line 92, in <module>
>     url(r'^', include(router.urls)),
>   File 
line 82, in urls
>     self._urls = self.get_urls()
>   File "~/.local/lib/python2.7/site-packages/rest_framework/", 
line 373, in get_urls
>     urls = super(DefaultRouter, self).get_urls()
>   File "~/.local/lib/python2.7/site-packages/rest_framework/", 
line 271, in get_urls
>     view = viewset.as_view(mapping, **route.initkwargs)
>   File "~/.local/lib/python2.7/site-packages/rest_framework/", 
line 67, in as_view
>     cls.__name__, key))

but what I want is an _additional_ endpoint so I can lookup records by 
either pk _or_ uuid.

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 
For more options, visit

Reply via email to