laymonage / django-jsonfield-backport

Backport of the cross-DB JSONField model and form fields from Django 3.1.
https://pypi.org/project/django-jsonfield-backport
BSD 3-Clause "New" or "Revised" License
42 stars 6 forks source link

AttributeError: 'DatabaseFeatures' object has no attribute 'has_native_json_field' #28

Closed jtzgyw closed 3 years ago

jtzgyw commented 3 years ago

python 3.6.8 django 2.2.18

File "\yuemia\TianQing\venv\lib\site-packages\django\db\models\query.py", line 72, in __iter__
  for row in compiler.results_iter(results):
File "\yuemia\TianQing\venv\lib\site-packages\django\db\models\sql\compiler.py", line 1086, in apply_converters
  value = converter(value, expression, connection)
File "\yuemia\TianQing\venv\lib\site-packages\django_jsonfield_backport\models.py", line 111, in from_db_value
  if connection.features.has_native_json_field and self.decoder is None:
AttributeError: 'DatabaseFeatures' object has no attribute 'has_native_json_field'
laymonage commented 3 years ago

@ugvibib Have you added the package to INSTALLED_APPS? See https://github.com/laymonage/django-jsonfield-backport/issues/14 and https://github.com/laymonage/django-jsonfield-backport/issues/23

jtzgyw commented 3 years ago

@ugvibib Have you added the package to INSTALLED_APPS? See #14 and #23

It's my problem, Thanks!