Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/py-wagtail Explicitly depend on django-filter. Mer...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/49c541294a17
branches:  trunk
changeset: 437301:49c541294a17
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Thu Aug 20 12:58:35 2020 +0000

description:
Explicitly depend on django-filter. Merge a pull request to fix a big
for custom document models. Bump revision.

diffstat:

 www/py-wagtail/Makefile                                          |   7 +-
 www/py-wagtail/distinfo                                          |   4 +-
 www/py-wagtail/patches/patch-wagtail_documents_forms.py          |  26 ++++++++
 www/py-wagtail/patches/patch-wagtail_documents_views_multiple.py |  32 ++++++++++
 4 files changed, 67 insertions(+), 2 deletions(-)

diffs (111 lines):

diff -r d2fd2386091f -r 49c541294a17 www/py-wagtail/Makefile
--- a/www/py-wagtail/Makefile   Thu Aug 20 11:37:48 2020 +0000
+++ b/www/py-wagtail/Makefile   Thu Aug 20 12:58:35 2020 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.4 2020/08/18 01:16:13 joerg Exp $
+# $NetBSD: Makefile,v 1.5 2020/08/20 12:58:35 joerg Exp $
 
 DISTNAME=      wagtail-2.10
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
+PKGREVISION=   1
 CATEGORIES=    www python
 MASTER_SITES=  ${MASTER_SITE_PYPI:=w/wagtail/}
 
@@ -11,6 +12,7 @@
 LICENSE=       modified-bsd
 
 DEPENDS+=      ${PYPKGPREFIX}-django>=2<3.1:../../www/py-django2
+DEPENDS+=      ${PYPKGPREFIX}-django-filter>=2.2.0:../../www/py-django-filter
 DEPENDS+=      ${PYPKGPREFIX}-django-modelcluster>=5.0<6.0:../../www/py-django-modelcluster
 DEPENDS+=      ${PYPKGPREFIX}-django-taggit>=1.0<2.0:../../www/py-django-taggit
 DEPENDS+=      ${PYPKGPREFIX}-django-treebeard>=4.2<5.0:../../www/py-django-treebeard
@@ -38,6 +40,9 @@
 
 REPLACE_PYTHON+=       wagtail/project_template/manage.py
 
+pre-install:
+       ${FIND} ${WRKSRC} -name '*.orig' -delete
+
 do-test:
        cd ${WRKSRC} && ${PREFIX}/bin/coverage-${PYVERSSUFFIX} run -m django test --settings=wagtail.tests.settings
 
diff -r d2fd2386091f -r 49c541294a17 www/py-wagtail/distinfo
--- a/www/py-wagtail/distinfo   Thu Aug 20 11:37:48 2020 +0000
+++ b/www/py-wagtail/distinfo   Thu Aug 20 12:58:35 2020 +0000
@@ -1,7 +1,9 @@
-$NetBSD: distinfo,v 1.2 2020/08/18 01:16:13 joerg Exp $
+$NetBSD: distinfo,v 1.3 2020/08/20 12:58:35 joerg Exp $
 
 SHA1 (wagtail-2.10.tar.gz) = fe4d9a9d9d852ff7544bb931509e0bb03c0431ef
 RMD160 (wagtail-2.10.tar.gz) = 5e1505d6b5ee2bd4690c9692be7db8b740291064
 SHA512 (wagtail-2.10.tar.gz) = e90beb0372a11c1d9666d860c17d0599300df740bb49712c8eb9b2e46aa69998cbdc2cd6ab6a2faba6bc20d1266da6313aac019808284ad3994efaef93a3f386
 Size (wagtail-2.10.tar.gz) = 8706446 bytes
 SHA1 (patch-setup.py) = ead66cd931d462e6ea94c37da5b8200beffc5cb2
+SHA1 (patch-wagtail_documents_forms.py) = de884d59913addcbb2f20a9c6264fe2a6bc29ae6
+SHA1 (patch-wagtail_documents_views_multiple.py) = 2fd96cf16ee5728b452e40e658d165c72e901824
diff -r d2fd2386091f -r 49c541294a17 www/py-wagtail/patches/patch-wagtail_documents_forms.py
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/py-wagtail/patches/patch-wagtail_documents_forms.py   Thu Aug 20 12:58:35 2020 +0000
@@ -0,0 +1,26 @@
+$NetBSD: patch-wagtail_documents_forms.py,v 1.1 2020/08/20 12:58:35 joerg Exp $
+
+#6337
+
+--- wagtail/documents/forms.py.orig    2020-08-18 20:47:57.396518448 +0000
++++ wagtail/documents/forms.py
+@@ -32,6 +32,19 @@ def get_document_form(model):
+         })
+ 
+ 
++def get_document_upload_form(model):
++    fields = ('title', 'collection', 'file')
++
++    return modelform_factory(
++        model,
++        form=BaseDocumentForm,
++        fields=fields,
++        widgets={
++            'tags': widgets.AdminTagWidget,
++            'file': forms.FileInput()
++        })
++
++
+ def get_document_multi_form(model):
+     fields = [field for field in model.admin_form_fields if field != 'file']
+     if 'collection' not in fields:
diff -r d2fd2386091f -r 49c541294a17 www/py-wagtail/patches/patch-wagtail_documents_views_multiple.py
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/py-wagtail/patches/patch-wagtail_documents_views_multiple.py  Thu Aug 20 12:58:35 2020 +0000
@@ -0,0 +1,32 @@
+$NetBSD: patch-wagtail_documents_views_multiple.py,v 1.1 2020/08/20 12:58:35 joerg Exp $
+
+#6337
+
+--- wagtail/documents/views/multiple.py.orig   2020-08-11 09:43:49.000000000 +0000
++++ wagtail/documents/views/multiple.py
+@@ -12,7 +12,7 @@ from wagtail.core.models import Collecti
+ from wagtail.search.backends import get_search_backends
+ 
+ from .. import get_document_model
+-from ..forms import get_document_form, get_document_multi_form
++from ..forms import get_document_form, get_document_upload_form, get_document_multi_form
+ from ..permissions import permission_policy
+ 
+ permission_checker = PermissionPolicyChecker(permission_policy)
+@@ -23,6 +23,7 @@ permission_checker = PermissionPolicyChe
+ def add(request):
+     Document = get_document_model()
+     DocumentForm = get_document_form(Document)
++    DocumentUploadForm = get_document_upload_form(Document)
+     DocumentMultiForm = get_document_multi_form(Document)
+ 
+     collections = permission_policy.collections_user_has_permission_for(request.user, 'add')
+@@ -40,7 +41,7 @@ def add(request):
+             return HttpResponseBadRequest("Must upload a file")
+ 
+         # Build a form for validation
+-        form = DocumentForm({
++        form = DocumentUploadForm({
+             'title': request.FILES['files[]'].name,
+             'collection': request.POST.get('collection'),
+         }, {



Home | Main Index | Thread Index | Old Index