Django permissions framework vs DRF permissions

2019-05-18 Thread Rounak Jain
Newbie here. I want to create hierarchical permissions in Django, very similar to one described here: https://stackoverflow.com/questions/49300215/django-hierarchy-permissions I have read about Django permissions framework and https://github.com/vintasoftware/django-role-permissions I don't un

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') urlpatt

Show different views based on user

2019-05-22 Thread Rounak Jain
I am new to Django. Below code returns objects created by the logged in user. If the user's role property has value 'super', then I want all the objects to be shown. If the user's role property is 'inter', then I want to show all objects except objects created by 'super'. Where is the right place t

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

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 >> poss