Re: Write urls without regex in DRF

2019-05-23 Thread nm
Yes, it's possible to write this code without using regexp, and it should work the same. If you have a look at the source code of the routers, there's a method `get_urls` in SimpleRouter (you can find it here

Re: Write urls without regex in DRF

2019-05-22 Thread Rounak Jain
I cannot see any reply On Thursday, May 23, 2019 at 7:56:54 AM UTC+5:30, Kevin Jay wrote: > > kevin@kjay,net > > On Wed, May 22, 2019 at 10:19 AM Rounak Jain > wrote: > >> >> I am using DRF Viewsets to auto-generate URLs for different views. Is it >> possible to write the code below without

Re: Write urls without regex in DRF

2019-05-22 Thread Kevin Jay
kevin@kjay,net On Wed, May 22, 2019 at 10:19 AM Rounak Jain wrote: > > I am using DRF Viewsets to auto-generate URLs for different views. Is it > possible to write the code below without using regex? > Thanks > > from .views import TaskViewSet > from rest_framework.routers import DefaultRouter

Re: Write urls without regex in DRF

2019-05-22 Thread Rounak Jain
Thanks for the reply. I understand how to use them in urls.py when creating normal routes but here in case of drf, it would help if you could show me how to do it On Wed, May 22, 2019 at 10:11 PM Onasanya Tunde wrote: > Use Django2.X > > -- > You received this message because you are subscribed

Write urls without regex in DRF

2019-05-22 Thread Onasanya Tunde
Use Django2.X -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to

Write urls without regex in DRF

2019-05-22 Thread Rounak Jain
I am using DRF Viewsets to auto-generate URLs for different views. Is it possible to write the code below without using regex? Thanks from .views import TaskViewSet from rest_framework.routers import DefaultRouter router = DefaultRouter() router.register(r'', TaskViewSet, basename='task')