GithubHelp home page GithubHelp logo

Comments (4)

rpkilby avatar rpkilby commented on August 27, 2024

Hi @snewcomer. Most likely, you're inheriting from django_filters.FilterSet instead of rest_framework_filters.FilterSet. By default, any unrecognized keywords are passed to the underlying form Field, which is probably what's raising the error.

from django-rest-framework-filters.

snewcomer avatar snewcomer commented on August 27, 2024

@rpkilby so I should have mentioned I am using the standard django orm, basically manually parsing and calling

queryset.filter(**kwargs) where kwargs may be {'name__icontains': 'foo'}

This is probably my problem as I am not inheriting the filters.FilterSet class at all....The only setting I have related to rest_framework_filters is (in the settings file)

REST_FRAMEWORK = {
    ...
    'DEFAULT_FILTER_BACKENDS': (
        'rest_framework_filters.backends.DjangoFilterBackend', ...
    ),

from django-rest-framework-filters.

rpkilby avatar rpkilby commented on August 27, 2024

I'm a little confused as to the usage. If you're not using FilterSets, there would be no need to use the backend. Could you provide a more complete example of the view, filterset, etc..?

from django-rest-framework-filters.

snewcomer avatar snewcomer commented on August 27, 2024

Yep this is my mistake. Thanks for pointing it out. I'll have to figure out why we aren't using this great package!

from django-rest-framework-filters.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.