Project

Profile

Help

Issue #9307

Modelresources incorrectly set json fields to use Widget instead of JSONWidget

Added by daviddavis about 2 months ago. Updated 19 days 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 - CURRENTRELEASE<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision 225360ca View on GitHub
Added by daviddavis about 2 months ago

Set WIDGET_MAP for model resources to handle JSON fields

fixes #9307

History

#1 Updated by daviddavis about 2 months 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

#2 Updated by daviddavis about 2 months 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

#3 Updated by daviddavis about 2 months ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to daviddavis

#4 Updated by pulpbot about 2 months ago

  • Status changed from ASSIGNED to POST

#5 Updated by daviddavis about 2 months ago

  • Status changed from POST to MODIFIED

#6 Updated by daviddavis about 2 months ago

#7 Updated by daviddavis about 2 months ago

  • Sprint/Milestone deleted (3.15.1)

#8 Updated by pulpbot 19 days ago

  • Sprint/Milestone set to 3.16.0

#9 Updated by pulpbot 19 days ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF