django-jsonfallback
django-jsonfallback copied to clipboard
Does not work correcly on Postgresql with Postgis extensions
When using a Postgresql with Postgis extensions, the driver used is a wrapper around the postgres one to handle postgis extensions.
Unfortunately, the driver name does not contains '.postgresql' in the engine name.
The engine string is django.contrib.gis.db.backends.postgis
So maybe change some tests like
if '.postgresql' in connection.settings_dict['ENGINE']:
To
if any((
'.postgresql' in connection.settings_dict['ENGINE'],
'.postgis' in connection.settings_dict['ENGINE']
)):
Or just shorten the search:
if '.postg' in connection.settings_dict['ENGINE']:
I'd be happy to accept a pull request, although keep in mind that we'll probably discontinue this library as soon as django 3.1 has been released and we've found a good migration path:
https://docs.djangoproject.com/en/dev/releases/3.1/#jsonfield-for-all-supported-database-backends