Commit e93c3890 authored by Philippe Pepiot's avatar Philippe Pepiot
Browse files

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
parent 9f9a57e950bf
......@@ -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
......
......@@ -14,7 +14,7 @@ description = 'Data Exchange Standard for Archival'
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',
......
......@@ -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
@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 ()
......@@ -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),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment