Require CubicWeb 3.25.3 and drop related monkeypatches
authorPhilippe Pepiot <philippe.pepiot@logilab.fr>
Tue, 17 Oct 2017 12:11:41 +0200
changeset 2776 f84752939e76
parent 2775 9f9a57e950bf
child 2777 ee2a3ec087c6
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
cubicweb-seda.spec
cubicweb_seda/__pkginfo__.py
cubicweb_seda/views/patches.py
debian/control
--- a/cubicweb-seda.spec	Mon Oct 16 15:45:07 2017 +0200
+++ b/cubicweb-seda.spec	Tue Oct 17 12:11:41 2017 +0200
@@ -20,7 +20,7 @@
 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
--- a/cubicweb_seda/__pkginfo__.py	Mon Oct 16 15:45:07 2017 +0200
+++ b/cubicweb_seda/__pkginfo__.py	Tue Oct 17 12:11:41 2017 +0200
@@ -14,7 +14,7 @@
 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',
--- a/cubicweb_seda/views/patches.py	Mon Oct 16 15:45:07 2017 +0200
+++ b/cubicweb_seda/views/patches.py	Tue Oct 17 12:11:41 2017 +0200
@@ -46,54 +46,3 @@
 # 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
-
-
-@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))
-
-
-@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 ()
--- a/debian/control	Mon Oct 16 15:45:07 2017 +0200
+++ b/debian/control	Tue Oct 17 12:11:41 2017 +0200
@@ -12,7 +12,7 @@
 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),