Negated filtering by lookup expression sent via url query

40 views
Skip to first unread message

Sencer Hamarat

unread,
May 31, 2022, 9:46:38 AM5/31/22
to django...@googlegroups.com

Hi,

Is there any way to negate filtering with the django-filter package which lookup expression sent via url query, such as:



The request above has to be passed through the django filterset class and the class has to be returned with the queryset exclude query with name argument and "john" value.

Something like:

self.queryset.exclude(name="john")

Kind regards,
Sencer HAMARAT

Lalit Suthar

unread,
May 31, 2022, 9:52:13 AM5/31/22
to django...@googlegroups.com
you can write custom filtering classes and methods using Django filters.
There you can define fields and methods according to your use case

--
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/CACp8TZg0QFj2kST7m%3DoM4AoS3%3D3DOBhTm0MzDpJvLup_woYEYQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages