<div dir="ltr">A few weeks ago, Katello opened an issue[0] requesting a set of "not equal" filters (ie filters where a field is not equal to a certain value). I created a pulpcore issue[0] to investigate whether pulpcore could provide this functionality and it seems there are a few different options. I wanted to ask for feedback though as this would affect the user experience and thus whatever option we choose would be permanent.<div><br></div><div>There are three options:</div><div><br></div><div>1. First there is a package which adds functionality on top of django-rest-framework-filters[1] which dynamically provides filters for every field using ! (eg name!=value, state!=value). The problem is that the package doesn't look like it's well maintained[2] and we'd quickly run into problems when we try to upgrade to django 3 for example[3]. We'd probably have to fork the project or take over ownership somehow.</div><div><br></div><div>2. The second solution is that we can try to import the code from django-rest-framework-filters that creates these dynamic filters. This would free us from having to support any other features from django-rest-framework-filters we don't want to support.</div><div><br></div><div>3. The third option is to create a django scope (ie "ne") that would allow plugin writers to manually define filters like "name__eq=value". This solution seems the most verbose/explicit/straightforward but also the most work for plugin writers. I have a couple PRs open to demonstrate this solution:</div><div><br></div><div><a href="https://github.com/pulp/pulp_rpm/pull/1559">https://github.com/pulp/pulp_rpm/pull/1559</a><br></div><div><a href="https://github.com/pulp/pulpcore/pull/452">https://github.com/pulp/pulpcore/pull/452</a><br></div><div><br></div><div>I'll try to move forward with a solution next week. Feedback before then would be much appreciated.</div><div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><br></div><div>[0] <a href="https://pulp.plan.io/issues/5854">https://pulp.plan.io/issues/5854</a></div><div>[1] <a href="https://github.com/philipn/django-rest-framework-filters">https://github.com/philipn/django-rest-framework-filters</a></div><div>[2] <a href="https://github.com/philipn/django-rest-framework-filters/issues/324">https://github.com/philipn/django-rest-framework-filters/issues/324</a> and <a href="https://github.com/philipn/django-rest-framework-filters/issues/287">https://github.com/philipn/django-rest-framework-filters/issues/287</a></div><div>[3] <a href="https://github.com/philipn/django-rest-framework-filters/issues/326">https://github.com/philipn/django-rest-framework-filters/issues/326</a></div><div><br></div><div>David<br></div></div></div></div></div></div></div></div></div></div></div>