Project

Profile

Help

Issue #9307

closed

Modelresources incorrectly set json fields to use Widget instead of JSONWidget

Added by daviddavis about 3 years ago. Updated about 3 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
Actions #1

Updated by daviddavis about 3 years ago

  • Subject changed from Modelresources incorrectly set widgets to Widget instead of JSONWidget to Modelresources incorrectly set json fields to use Widget instead of JSONWidget
Actions #2

Updated by daviddavis about 3 years ago

I filed an issue to ask for a new release of django-import-export: https://github.com/django-import-export/django-import-export/issues/1321

Actions #3

Updated by daviddavis about 3 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to daviddavis
Actions #4

Updated by pulpbot about 3 years ago

  • Status changed from ASSIGNED to POST

Added by daviddavis about 3 years ago

Revision 225360ca | View on GitHub

Set WIDGET_MAP for model resources to handle JSON fields

fixes #9307

Actions #5

Updated by daviddavis about 3 years ago

  • Status changed from POST to MODIFIED
Actions #6

Updated by daviddavis about 3 years ago

Actions #7

Updated by daviddavis about 3 years ago

  • Sprint/Milestone deleted (3.15.1)
Actions #8

Updated by pulpbot about 3 years ago

  • Sprint/Milestone set to 3.16.0
Actions #9

Updated by pulpbot about 3 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF