morlandi / django-ajax-datatable

A Django app which provides the integration of a Django project with the jQuery Javascript library DataTables.net
MIT License
204 stars 64 forks source link

Changes in Django 4 #75

Closed abiblair closed 2 years ago

abiblair commented 2 years ago

I've just tried updating a dev project to Django 4 and found the following things (sorry daren't submit as requests... dont want to mess things up!!)

Changes to ugettext_lazy

from django.utils.translation import ugettextlazy as is now replace by from django.utils.translation import gettextlazy as

Locations:

\ajax_datatable\columns.py \ajax_datatable\views.py

Deprecation of is_ajax

request.is_ajax() is now achieved using request.headers.get('x-requested-with') == 'XMLHttpRequest'

Locations

\ajax_datatable\views.py (lines 371 & 520)

I made the change above to my local setup and all seems to work fine.

morlandi commented 2 years ago

Thank you ... there is a PR #52 for this, but I think it breaks backward compatibility with Django < 4.

Hopefully I will fix this soon ;)

abiblair commented 2 years ago

Aah sorry I didn't spot that! :) Many thanks for your work. I user this app all the time.

morlandi commented 2 years ago

Thank your interest in the project ;) I was finally able to publish a fix which should work for both Django 4.0 and previous versions