Comments (6)
Fixed !
from django-rest-framework-datatables.
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.
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.
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.
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.
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)
- "Illegal mix of collations for operation 'like'" utf8 search error HOT 3
- Travis build not running HOT 1
- DatatablesPageNumberPagination Ignores "PAGE_SIZE" default parameter in settings.py
- How to filter by date HOT 1
- DatatablesFilterBackend: performance gain by removing call to count() HOT 3
- Serverside sorting with ForeignKey produces duplicate HOT 4
- Export all the results to the CSV HOT 1
- DatabaseError when using search HOT 1
- Issue retrieving fields with a 'source' attribute HOT 2
- Can't get filter method to work
- filter post with id
- can not disable paginintion for specific views HOT 2
- d.date and d.images return undefined in ?format=datatables but not with ?format=json HOT 1
- Sorting and pagintion and searching produces problemes
- Fail when using SQL query 'RawQuerySet' object has no attribute 'count' HOT 3
- deprecation warning due to no pyproject.toml
- Project dead? HOT 1
- Support for Datatables SearchBuilder?
- Default global and column search is not working in POST method
- Datatables incorrectly calculates the number of pages with custom filter_backend
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-rest-framework-datatables.