Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-django-tagging for
openSUSE:Factory checked in at 2022-02-25 21:25:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-django-tagging (Old)
and /work/SRC/openSUSE:Factory/.python-django-tagging.new.1958 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-django-tagging"
Fri Feb 25 21:25:16 2022 rev:3 rq:957599 version:0.5.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-django-tagging/python-django-tagging.changes
2020-04-04 12:26:51.588016515 +0200
+++
/work/SRC/openSUSE:Factory/.python-django-tagging.new.1958/python-django-tagging.changes
2022-02-25 21:25:48.851646258 +0100
@@ -1,0 +2,6 @@
+Fri Feb 25 13:32:54 UTC 2022 - Matej Cepl <[email protected]>
+
+- Add django4.patch to allow compatibility with Django 4
+ (gh#Fantomas42/django-tagging#23).
+
+-------------------------------------------------------------------
New:
----
django4.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-django-tagging.spec ++++++
--- /var/tmp/diff_new_pack.vMilnD/_old 2022-02-25 21:25:49.271646333 +0100
+++ /var/tmp/diff_new_pack.vMilnD/_new 2022-02-25 21:25:49.275646334 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-django-tagging
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -26,6 +26,9 @@
Group: Development/Libraries/Python
URL: https://github.com/Fantomas42/django-tagging
Source:
https://files.pythonhosted.org/packages/source/d/django-tagging/django-tagging-%{version}.tar.gz
+# PATCH-FIX-UPSTREAM django4.patch gh#Fantomas42/django-tagging#23
[email protected]
+# Make the package working with Django 4
+Patch0: django4.patch
BuildRequires: %{python_module Django >= 2.2}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
@@ -40,7 +43,7 @@
with any Model instance and makes retrieval of tags simple.
%prep
-%setup -q -n django-tagging-%{version}
+%autosetup -p1 -n django-tagging-%{version}
%build
%python_build
@@ -50,7 +53,7 @@
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
-%python_expand %{_bindir}/django-admin.py-%{$python_bin_suffix} test
--settings=tagging.tests.settings --pythonpath=`pwd`
+%python_expand %{_bindir}/django-admin-%{$python_bin_suffix} test
--settings=tagging.tests.settings --pythonpath=`pwd`
%files %{python_files}
%license LICENSE.txt
++++++ django4.patch ++++++
>From f3622e62112c3ecc89eabb2512b1b3dd2e5e6ca0 Mon Sep 17 00:00:00 2001
From: Fantomas42 <[email protected]>
Date: Fri, 6 Mar 2020 19:00:00 +0100
Subject: [PATCH 1/4] Fix typo
---
tagging/models.py | 10 ++++++----
tagging/tests/urls.py | 12 ++++++------
2 files changed, 12 insertions(+), 10 deletions(-)
--- a/tagging/models.py
+++ b/tagging/models.py
@@ -5,7 +5,8 @@ from django.contrib.contenttypes.fields
from django.contrib.contenttypes.models import ContentType
from django.db import connection
from django.db import models
-from django.utils.encoding import smart_text
+from django.db.models.query_utils import Q
+from django.utils.encoding import smart_str
from django.utils.translation import gettext_lazy as _
from tagging import settings
@@ -155,8 +156,9 @@ class TagManager(models.Manager):
filters = {}
queryset = model._default_manager.filter()
- for f in filters.items():
- queryset.query.add_filter(f)
+ for k, v in filters.items():
+ # Add support for both Django 4 and inferior versions
+ queryset.query.add_q(Q((k, v)))
usage = self.usage_for_queryset(queryset, counts, min_count)
return usage
@@ -519,4 +521,4 @@ class TaggedItem(models.Model):
verbose_name_plural = _('tagged items')
def __str__(self):
- return '%s [%s]' % (smart_text(self.object), smart_text(self.tag))
+ return '%s [%s]' % (smart_str(self.object), smart_str(self.tag))
--- a/tagging/tests/urls.py
+++ b/tagging/tests/urls.py
@@ -1,5 +1,5 @@
"""Test urls for tagging."""
-from django.conf.urls import url
+from django.urls import re_path
from tagging.tests.models import Article
from tagging.views import TaggedObjectList
@@ -11,10 +11,10 @@ class StaticTaggedObjectList(TaggedObjec
urlpatterns = [
- url(r'^static/$', StaticTaggedObjectList.as_view()),
- url(r'^static/related/$', StaticTaggedObjectList.as_view(
+ re_path(r'^static/$', StaticTaggedObjectList.as_view()),
+ re_path(r'^static/related/$', StaticTaggedObjectList.as_view(
related_tags=True)),
- url(r'^no-tag/$', TaggedObjectList.as_view(model=Article)),
- url(r'^no-query-no-model/$', TaggedObjectList.as_view()),
- url(r'^(?P<tag>[^/]+(?u))/$', TaggedObjectList.as_view(model=Article)),
+ re_path(r'^no-tag/$', TaggedObjectList.as_view(model=Article)),
+ re_path(r'^no-query-no-model/$', TaggedObjectList.as_view()),
+ re_path(r'^(?P<tag>[^/]+(?u))/$', TaggedObjectList.as_view(model=Article)),
]