Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-django-import-export for 
openSUSE:Factory checked in at 2026-06-28 21:06:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-django-import-export (Old)
 and      /work/SRC/openSUSE:Factory/.python-django-import-export.new.11887 
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-django-import-export"

Sun Jun 28 21:06:24 2026 rev:13 rq:1362003 version:4.4.1

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-django-import-export/python-django-import-export.changes
  2026-03-07 20:14:09.782373188 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-django-import-export.new.11887/python-django-import-export.changes
       2026-06-28 21:07:06.327229210 +0200
@@ -1,0 +2,9 @@
+Sat Jun 27 15:46:34 UTC 2026 - Dirk Müller <[email protected]>
+
+- update to 4.4.1:
+  * Refactor lookup value retrieval in Field and
+    CachedForeignKeyWidget (2146)
+  * Fix CachedForeignKeyWidget type mismatch on non-string lookup
+    fields (2159)
+
+-------------------------------------------------------------------

Old:
----
  django_import_export-4.4.0.tar.gz

New:
----
  django_import_export-4.4.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-django-import-export.spec ++++++
--- /var/tmp/diff_new_pack.k5go8c/_old  2026-06-28 21:07:06.831246193 +0200
+++ /var/tmp/diff_new_pack.k5go8c/_new  2026-06-28 21:07:06.831246193 +0200
@@ -18,7 +18,7 @@
 
 %{?sle15_python_module_pythons}
 Name:           python-django-import-export
-Version:        4.4.0
+Version:        4.4.1
 Release:        0
 Summary:        Django data importing and exporting
 License:        BSD-2-Clause

++++++ django_import_export-4.4.0.tar.gz -> django_import_export-4.4.1.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django_import_export-4.4.0/PKG-INFO 
new/django_import_export-4.4.1/PKG-INFO
--- old/django_import_export-4.4.0/PKG-INFO     2026-01-10 21:57:09.042009400 
+0100
+++ new/django_import_export-4.4.1/PKG-INFO     2026-05-05 14:42:12.758282700 
+0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.4
 Name: django-import-export
-Version: 4.4.0
+Version: 4.4.1
 Summary: Django application and library for importing and exporting data with 
included admin integration.
 Author-email: Bojan Mihelač <[email protected]>
 Maintainer-email: Matthew Hegarty <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/django_import_export-4.4.0/django_import_export.egg-info/PKG-INFO 
new/django_import_export-4.4.1/django_import_export.egg-info/PKG-INFO
--- old/django_import_export-4.4.0/django_import_export.egg-info/PKG-INFO       
2026-01-10 21:57:08.000000000 +0100
+++ new/django_import_export-4.4.1/django_import_export.egg-info/PKG-INFO       
2026-05-05 14:42:12.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.4
 Name: django-import-export
-Version: 4.4.0
+Version: 4.4.1
 Summary: Django application and library for importing and exporting data with 
included admin integration.
 Author-email: Bojan Mihelač <[email protected]>
 Maintainer-email: Matthew Hegarty <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django_import_export-4.4.0/docs/changelog.rst 
new/django_import_export-4.4.1/docs/changelog.rst
--- old/django_import_export-4.4.0/docs/changelog.rst   2026-01-10 
21:57:05.000000000 +0100
+++ new/django_import_export-4.4.1/docs/changelog.rst   2026-05-05 
14:42:03.000000000 +0200
@@ -5,6 +5,12 @@
 
     If upgrading from v3, v4 introduces breaking changes.  Please refer to 
:doc:`release notes<release_notes>`.
 
+4.4.1 (2026-05-05)
+-------------------
+
+- Refactor lookup value retrieval in Field and CachedForeignKeyWidget (`2146 
<https://github.com/django-import-export/django-import-export/pull/2146>`_)
+- Fix CachedForeignKeyWidget type mismatch on non-string lookup fields (`2159 
<https://github.com/django-import-export/django-import-export/pull/2159>`_)
+
 4.4.0 (2026-01-10)
 -------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django_import_export-4.4.0/import_export/_version.py 
new/django_import_export-4.4.1/import_export/_version.py
--- old/django_import_export-4.4.0/import_export/_version.py    2026-01-10 
21:57:08.000000000 +0100
+++ new/django_import_export-4.4.1/import_export/_version.py    2026-05-05 
14:42:12.000000000 +0200
@@ -1,5 +1,6 @@
-# file generated by setuptools-scm
+# file generated by vcs-versioning
 # don't change, don't track in version control
+from __future__ import annotations
 
 __all__ = [
     "__version__",
@@ -10,25 +11,14 @@
     "commit_id",
 ]
 
-TYPE_CHECKING = False
-if TYPE_CHECKING:
-    from typing import Tuple
-    from typing import Union
-
-    VERSION_TUPLE = Tuple[Union[int, str], ...]
-    COMMIT_ID = Union[str, None]
-else:
-    VERSION_TUPLE = object
-    COMMIT_ID = object
-
 version: str
 __version__: str
-__version_tuple__: VERSION_TUPLE
-version_tuple: VERSION_TUPLE
-commit_id: COMMIT_ID
-__commit_id__: COMMIT_ID
+__version_tuple__: tuple[int | str, ...]
+version_tuple: tuple[int | str, ...]
+commit_id: str | None
+__commit_id__: str | None
 
-__version__ = version = '4.4.0'
-__version_tuple__ = version_tuple = (4, 4, 0)
+__version__ = version = '4.4.1'
+__version_tuple__ = version_tuple = (4, 4, 1)
 
-__commit_id__ = commit_id = 'gc8a10790b'
+__commit_id__ = commit_id = 'gf4cfc4d09'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django_import_export-4.4.0/import_export/admin.py 
new/django_import_export-4.4.1/import_export/admin.py
--- old/django_import_export-4.4.0/import_export/admin.py       2026-01-10 
21:57:05.000000000 +0100
+++ new/django_import_export-4.4.1/import_export/admin.py       2026-05-05 
14:42:03.000000000 +0200
@@ -684,6 +684,18 @@
         changelist_kwargs["search_help_text"] = self.search_help_text
 
         class ExportChangeList(ChangeList):
+            def get_filters_params(self, params=None):
+                """Strip params not intended as queryset filters.
+
+                ``_changelist_filters`` is added by Django to change-view URLs
+                when the user navigated there from a filtered changelist.  It 
is
+                not a model field lookup and must be ignored, otherwise
+                ``ChangeList`` raises ``IncorrectLookupParameters``.
+                """
+                result = super().get_filters_params(params)
+                result.pop("_changelist_filters", None)
+                return result
+
             def get_results(self, request):
                 """
                 Overrides ChangeList.get_results() to bypass default 
operations like
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django_import_export-4.4.0/import_export/forms.py 
new/django_import_export-4.4.1/import_export/forms.py
--- old/django_import_export-4.4.0/import_export/forms.py       2026-01-10 
21:57:05.000000000 +0100
+++ new/django_import_export-4.4.1/import_export/forms.py       2026-05-05 
14:42:03.000000000 +0200
@@ -33,7 +33,9 @@
             (i, resource.get_display_name()) for i, resource in 
enumerate(resources)
         ]
         if len(resources) == 1:
-            self.fields["resource"].widget = forms.HiddenInput()
+            self.fields["resource"].widget = forms.HiddenInput(
+                attrs={"id": "id_resource"}
+            )
             self.initial["resource"] = "0"
 
     def _init_formats(self, formats):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django_import_export-4.4.0/import_export/widgets.py 
new/django_import_export-4.4.1/import_export/widgets.py
--- old/django_import_export-4.4.0/import_export/widgets.py     2026-01-10 
21:57:05.000000000 +0100
+++ new/django_import_export-4.4.1/import_export/widgets.py     2026-05-05 
14:42:03.000000000 +0200
@@ -9,6 +9,7 @@
 import django
 from django.conf import settings
 from django.core.exceptions import ObjectDoesNotExist
+from django.db.models import F
 from django.utils import timezone
 from django.utils.dateparse import parse_duration
 from django.utils.encoding import force_str, smart_str
@@ -703,7 +704,7 @@
         self._instances = defaultdict(list)
         for instance in queryset:
             key = key_cls(
-                **{field: getattr(instance, field) for field in 
key_cls._fields}
+                **{field: str(getattr(instance, field)) for field in 
key_cls._fields}
             )
             self._instances[key].append(instance)
 
@@ -713,7 +714,7 @@
         Key = namedtuple("Key", list(lookup_fields.keys()))
 
         instances = self._get_instances(self.queryset, Key)
-        key = Key(**lookup_fields)
+        key = Key(**{k: str(v) for k, v in lookup_fields.items()})
         result = instances.get(key, [])
 
         if len(result) == 1:
@@ -799,6 +800,22 @@
         related object, default to False
     """
 
+    def _contains_relations(self):
+        return "__" in self.field
+
+    def get_queryset(self, value, row, *args, **kwargs):
+        queryset = super().get_queryset(value, row, *args, **kwargs)
+        if self._contains_relations():
+            queryset = queryset.annotate(
+                django_import_export_cached_lookup=F(self.field)
+            )
+        return queryset
+
+    def get_lookup_kwargs(self, value, row, **kwargs):
+        if self._contains_relations():
+            return {"django_import_export_cached_lookup": value}
+        return super().get_lookup_kwargs(value, row, **kwargs)
+
     def get_instance_by_lookup_fields(self, value, row, **kwargs):
         if not hasattr(self, "_cached_qs"):
             queryset = self.get_queryset(value, row, **kwargs)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/django_import_export-4.4.0/tests/core/tests/admin_integration/test_export.py
 
new/django_import_export-4.4.1/tests/core/tests/admin_integration/test_export.py
--- 
old/django_import_export-4.4.0/tests/core/tests/admin_integration/test_export.py
    2026-01-10 21:57:05.000000000 +0100
+++ 
new/django_import_export-4.4.1/tests/core/tests/admin_integration/test_export.py
    2026-05-05 14:42:03.000000000 +0200
@@ -165,6 +165,22 @@
 
         self.assertEqual(queryset.count(), Book.objects.count())
 
+    def test_get_export_queryset_with_changelist_filters_param(self):
+        """Test that _changelist_filters query param does not cause
+        IncorrectLookupParameters when exporting from a change view
+        reached via a filtered changelist."""
+        model_admin = BookAdmin(Book, AdminSite())
+
+        factory = RequestFactory()
+        request = factory.get(
+            self.book_export_url,
+            {"_changelist_filters": "author__id__exact=1"},
+        )
+        request.user = User.objects.create_user("admin1")
+
+        queryset = model_admin.get_export_queryset(request)
+        self.assertEqual(queryset.count(), Book.objects.count())
+
     def test_get_export_form_single_resource(self):
         response = self._get_url_response(self.category_export_url)
         content = response.content.decode()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/django_import_export-4.4.0/tests/core/tests/test_widgets.py 
new/django_import_export-4.4.1/tests/core/tests/test_widgets.py
--- old/django_import_export-4.4.0/tests/core/tests/test_widgets.py     
2026-01-10 21:57:05.000000000 +0100
+++ new/django_import_export-4.4.1/tests/core/tests/test_widgets.py     
2026-05-05 14:42:03.000000000 +0200
@@ -697,6 +697,10 @@
     def test_clean(self):
         self.assertEqual(self.widget.clean(self.author.id), self.author)
 
+    def test_clean_with_string_pk(self):
+        """Ensure lookup works when value is a string (as from CSV import)."""
+        self.assertEqual(self.widget.clean(str(self.author.id)), self.author)
+
     def test_clean_empty(self):
         self.assertEqual(self.widget.clean(""), None)
 
@@ -858,6 +862,20 @@
             str(e.exception),
         )
 
+    def test_with_related_fields(self):
+        author2 = Author.objects.create(name="Baz")
+        book = Book.objects.create(name="Baz", author=author2)
+        widget = widgets.CachedForeignKeyWidget(Book, "author__name")
+        with CaptureQueriesContext(connection) as ctx:
+            self.assertEqual(self.book, widget.clean(self.author.name))
+        self.assertEqual(len(ctx.captured_queries), 1)
+        with CaptureQueriesContext(connection) as ctx:
+            self.assertEqual(
+                book,
+                widget.clean(author2.name),
+            )
+        self.assertEqual(len(ctx.captured_queries), 0)
+
 
 class ManyToManyWidget(TestCase, RowDeprecationTestMixin):
     def setUp(self):

Reply via email to