GithubHelp home page GithubHelp logo

Comments (6)

izimobil avatar izimobil commented on May 17, 2024 1

Fixed !

from django-rest-framework-datatables.

morenoh149 avatar morenoh149 commented on May 17, 2024

did you try adding that key value to https://github.com/izimobil/django-rest-framework-datatables/blob/master/example/albums/templates/albums/albums.html#L65 ?

from django-rest-framework-datatables.

 avatar commented on May 17, 2024

I just did, the same result as in my app.

Console says Failed to load resource: the server responded with a status of 400 (Bad Request) and pop up with DataTables warning: table id=albums - Ajax error. For more information about this error, please see http://datatables.net/tn/7 gets displayed.
Log is "POST /api/albums/?format=datatables HTTP/1.1" 400 15407.

from django-rest-framework-datatables.

izimobil avatar izimobil commented on May 17, 2024

At the moment this is not possible, but it could be easily done by replacing request.query_params with request.POST in DRF-datatables code, a good test would be something like:

if request.POST.get('draw') is not None:
    params = request.POST
else:
    params = request.query_params

If you manage to make it work, feel free to open a PR with tests included.

Thanks.

from django-rest-framework-datatables.

 avatar commented on May 17, 2024

Thanks for that. I tried to make it work but didn't manage. I am getting 403 on my API endpoint after making that change in filters.py:

          # parse query params
          # getter = request.query_params.get
          if request.POST.get("draw") is not None:
              getter = request.POST.get
          else:
              getter = request.query_params.get

I am not sure if problem is that code or my ModelViewSet endpoint.

from django-rest-framework-datatables.

CristopherH95 avatar CristopherH95 commented on May 17, 2024

Is there any update regarding the possibility of integrating pull request #70, which seems to be related to this? I had planned to use this package, but the environment I'm working in has limits on query strings, which makes using GET requests only a challenge.

from django-rest-framework-datatables.

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.