[PATCH seda] Require CubicWeb 3.25.3 and drop related monkeypatches

Philippe Pepiot philippe.pepiot at logilab.fr
Tue Oct 17 13:27:50 CEST 2017


# HG changeset patch
# User Philippe Pepiot <philippe.pepiot at logilab.fr>
# Date 1508235101 -7200
#      Tue Oct 17 12:11:41 2017 +0200
# Node ID f84752939e76bf3a5df305cd0940599f23d9539e
# Parent  9f9a57e950bffe54cf5fcf8979b0d69b711de88f
# Available At https://hg.logilab.org/review/cubes/seda
#              hg pull https://hg.logilab.org/review/cubes/seda -r f84752939e76
Require CubicWeb 3.25.3 and drop related monkeypatches

Monkeypatches for derived rtags introduced a regression in SedaArchiveUnit
form. Since derived rtags are now relased in CubicWeb 3.25, let's move forward
and drop our broken monkeypatchs.

Related to extranet #37884173

diff --git a/cubicweb-seda.spec b/cubicweb-seda.spec
--- a/cubicweb-seda.spec
+++ b/cubicweb-seda.spec
@@ -20,7 +20,7 @@ BuildArch:      noarch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-buildroot
 
 BuildRequires:  %{python} %{python}-setuptools
-Requires:       cubicweb >= 3.24
+Requires:       cubicweb >= 3.25.3
 Requires:       cubicweb-eac
 Requires:       cubicweb-skos >= 0.12.1
 Requires:       cubicweb-compound >= 0.6
diff --git a/cubicweb_seda/__pkginfo__.py b/cubicweb_seda/__pkginfo__.py
--- a/cubicweb_seda/__pkginfo__.py
+++ b/cubicweb_seda/__pkginfo__.py
@@ -14,7 +14,7 @@ description = 'Data Exchange Standard fo
 web = 'http://www.cubicweb.org/project/%s' % distname
 
 __depends__ = {
-    'cubicweb': '>= 3.25, < 3.26',
+    'cubicweb': '>= 3.25.3, < 3.26',
     'six': '>= 1.4.0',
     'cubicweb-eac': None,
     'cubicweb-skos': '>= 0.12.1',
diff --git a/cubicweb_seda/views/patches.py b/cubicweb_seda/views/patches.py
--- a/cubicweb_seda/views/patches.py
+++ b/cubicweb_seda/views/patches.py
@@ -46,54 +46,3 @@ def __init__(self, *args, **kwargs):
 # this js file contains a custom implementation of addInlineCreationForm that propage
 # sedaContainerEID
 autoform.AutomaticEntityForm.needs_js += ('cubes.seda.form.js',)
-
-
-# Broken derivation for autoform_section (https://www.cubicweb.org/ticket/17107020)
-
-from itertools import repeat  # noqa
-from cubicweb.rtags import rtags_chain  # noqa
-from cubicweb.web.views import uicfg  # noqa
-
-
- at monkeypatch(uicfg.AutoformSectionRelationTags)
-def init(self, schema, check=True):
-    super(uicfg.AutoformSectionRelationTags, self).init(schema, check)
-    if self._parent is None:
-        self.apply(schema, self._initfunc_step2)
-    else:
-        # we still need to expand wildcard in defined keys
-        for key in list(self._tagdefs):
-            stype, rtype, otype, role = key
-            rschema = schema.rschema(rtype)
-            if stype == '*' and stype == '*':
-                concrete_rdefs = rschema.rdefs.keys()
-            elif stype == '*':
-                concrete_rdefs = zip(rschema.subjects(otype), repeat(otype))
-            elif otype == '*':
-                concrete_rdefs = zip(repeat(stype), rschema.objects(stype))
-            else:
-                concrete_rdefs = [(stype, otype)]
-            for sschema, oschema in concrete_rdefs:
-                self._init(sschema, rschema, oschema, role)
-                # also, we have to copy values for undefined section from
-                # the parent's rtag
-                formsections = self.get(sschema, rschema, oschema, role)
-                sectdict = uicfg._formsections_as_dict(formsections)
-                if 'main' in sectdict:
-                    sectdict.setdefault('inlined', sectdict['main'])
-                parent_formsections = self._parent.get(sschema, rschema, oschema, role)
-                parent_sectdict = uicfg._formsections_as_dict(parent_formsections)
-                for formtype, section in parent_sectdict.items():
-                    if formtype not in sectdict:
-                        formsections.add('%s_%s' % (formtype, section))
-
-
- at monkeypatch(uicfg.AutoformSectionRelationTags)
-def get(self, *key):
-    # overriden to avoid recomputing done in parent classes
-    for rtag in rtags_chain(self):
-        try:
-            return rtag._tagdefs[key]
-        except KeyError:
-            continue
-    return ()
diff --git a/debian/control b/debian/control
--- a/debian/control
+++ b/debian/control
@@ -12,7 +12,7 @@ X-Python-Version: >= 2.6
 Package: cubicweb-seda
 Architecture: all
 Depends:
- python-cubicweb (>= 3.24.0),
+ python-cubicweb (>= 3.25.3),
  cubicweb-eac,
  cubicweb-skos (>= 0.12.1),
  cubicweb-compound (>= 0.6),



More information about the saem-devel mailing list