def post in ListView

2021-11-24 Thread bnmng
Hi everyone, Is there anything dangerous about this? class ItemList(ListView): model = Item def post(self, request, *args, **kwargs): self.request.GET = self.request.POST return super().get(request, *args, **kwargs) I want to use this to accept filtering parameters from a

Re: def post in ListView

2021-11-24 Thread Lalit Suthar
you can use `query_params` On Wed, 24 Nov 2021 at 19:04, bnmng wrote: > Hi everyone, > > Is there anything dangerous about this? > class ItemList(ListView): > model = Item > def post(self, request, *args, **kwargs): > self.request.GET = self.request.POST > return super().

Re: def post in ListView

2021-11-24 Thread Lalit Suthar
oh my bad that is available in django rest framework only On Wed, 24 Nov 2021 at 22:41, Lalit Suthar wrote: > you can use `query_params` > > On Wed, 24 Nov 2021 at 19:04, bnmng wrote: > >> Hi everyone, >> >> Is there anything dangerous about this? >> class ItemList(ListView): >> model = It

Re: Multiple Templates in single list view

2021-11-24 Thread Lalit Suthar
> Anyone plz review my code i am struggling to figure out what the issue here is What is the issue you are trying to resolve right now? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails fro

Re: Multiple Templates in single list view

2021-11-24 Thread Lalit Suthar
I have gone through your views and template. They are looking fine to me. Are you getting any error? On Wed, 24 Nov 2021 at 23:02, Lalit Suthar wrote: > > Anyone plz review my code i am struggling to figure out what the issue > here is > > What is the issue you are trying to resolve right now? >

Permissions Model Inefficiency Killing DB

2021-11-24 Thread Ryan Skadberg
Hi All - Running Django 2.2.24 (Yes, I know, we are working on moving to 3.2) I've noticed some stalls in startup and finally have tracked it down. It appears when permissions are imported, it checks EVERY user for permissions, NOT just the ones in the user_user_permissions table. When y

Re: def post in ListView

2021-11-24 Thread bnmng
Thanks, though, Lalit. I realized I don't event have to do what I was originally doing. I can just do this: def post(self, request, *args, **kwargs): return super().get(request, *args, **kwargs) Then the post params are still available to the queryset method def get_queryset(self

RE: Permissions Model Inefficiency Killing DB

2021-11-24 Thread Mike Dewhirst
Do you think this is a consequence of permission complexity?I have instinctively avoided individual permissions for purely management reasons and stuck to user membership of auth groups (roles) and given permissions exclusively to groups.That postpones lookups to when they are needed.I can't im

Re: def post in ListView

2021-11-24 Thread Lalit Suthar
oh cool :D this is looking more pretty On Thu, 25 Nov 2021 at 02:49, bnmng wrote: > Thanks, though, Lalit. > > I realized I don't event have to do what I was originally doing. I can > just do this: > > def post(self, request, *args, **kwargs): > return super().get(request, *args, **kwar