Project

Profile

Help

Issue #9307

closed

Modelresources incorrectly set json fields to use Widget instead of JSONWidget

Added by daviddavis over 2 years ago. Updated over 2 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

See for example:

In [1]: from pulp_rpm.app.modelresource import PackageCategoryResource

In [2]: PackageCategoryResource.fields["group_ids"].__dict__
Out[2]: 
{'attribute': 'group_ids',
 'default': list,
 'column_name': 'group_ids',
 'widget': <import_export.widgets.Widget at 0x7f032a86aeb0>,
 'readonly': False,
 'saves_null_values': True}

This is caused by django-import-export not properly handling django.db.models.JSONField. In django-import-export 2.5.0 it only checks for django.contrib.postgres.fields.JSONField.

The fix is here but it hasn't been released yet:

https://github.com/django-import-export/django-import-export/commit/f348ef3782e60d44a2cedd0062179f0b9c798510


Related issues

Related to Pulp - Issue #9324: Backport #9307 to 3.15CLOSED - CURRENTRELEASEdaviddavisActions

Also available in: Atom PDF