oh cool :D this is looking more pretty

On Thu, 25 Nov 2021 at 02:49, bnmng <benja...@bnmng.com> 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, **kwargs)
> Then the post params are still available to the queryset method
>     def get_queryset(self):
>         if self.request.POST.get('query_submitted'):
>             ... do stuff ...
>
>
>
> On Wednesday, November 24, 2021 at 12:14:21 PM UTC-5 sutharl...@gmail.com
> wrote:
>
>> oh my bad that is available in django rest framework only
>>
>>
>> On Wed, 24 Nov 2021 at 22:41, Lalit Suthar <sutharl...@gmail.com> wrote:
>>
>>> you can use `query_params`
>>>
>>> On Wed, 24 Nov 2021 at 19:04, bnmng <benj...@bnmng.com> 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().get(request, *args, **kwargs)
>>>>
>>>> I want to use this to accept filtering parameters from a form in a list
>>>> view template. This ListView also has a get_queryset which returns a
>>>> filtered query based on the parameters
>>>>
>>>> --
>>>> 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...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/aa7a1392-e388-4727-b412-bd1329daa6c4n%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/aa7a1392-e388-4727-b412-bd1329daa6c4n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9e6d1ed0-0061-4e88-a715-c677d300461dn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/9e6d1ed0-0061-4e88-a715-c677d300461dn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGp2JVF4%3D-MsR_eVDk1JEU%3DmP34eFGRmukCkv_T0cgTaafE1-w%40mail.gmail.com.

Reply via email to