[PATCH 5 of 5 saem_ref] [seda] Configure SEDAArchiveUnit form for qualified ARK generation

Denis Laxalde denis.laxalde at logilab.fr
Wed Apr 11 16:30:09 CEST 2018


# HG changeset patch
# User Denis Laxalde <denis.laxalde at logilab.fr>
# Date 1523456986 -7200
#      Wed Apr 11 16:29:46 2018 +0200
# Node ID fc0082fd78d8bea829625a01309aa7018665cfb6
# Parent  acb40395ff4ce5f9896b92819bd27f183c4aecf2
# Available At http://hg.logilab.org/review/cubes/saem_ref
#              hg pull http://hg.logilab.org/review/cubes/saem_ref -r fc0082fd78d8
# EXP-Topic ark-for-archiveunit
[seda] Configure SEDAArchiveUnit form for qualified ARK generation

CONSEJIRA-431

diff --git a/cubicweb_saem_ref/views/seda.py b/cubicweb_saem_ref/views/seda.py
--- a/cubicweb_saem_ref/views/seda.py
+++ b/cubicweb_saem_ref/views/seda.py
@@ -15,6 +15,7 @@
 # with this program. If not, see <http://www.gnu.org/licenses/>.
 """cubicweb-saem-ref views related to SEDA"""
 
+from cubicweb.web import formwidgets as fw
 from cubicweb.web.views import uicfg
 
 from cubicweb_seda.views import (
@@ -26,6 +27,7 @@ from cubicweb_seda.views import (
 )
 
 
+affk = uicfg.autoform_field_kwargs
 afs = uicfg.autoform_section
 pvs = uicfg.primaryview_section
 
@@ -42,6 +44,12 @@ afs.tag_object_of(('*', 'use_profile', '
 pvs.tag_attribute(('SEDABinaryDataObject', 'filename'), 'hidden')
 afs.tag_attribute(('SEDABinaryDataObject', 'filename'), 'main', 'hidden')
 
+# Have "seda_archive_unit" inserted in attributes section so that it appears
+# in cw_edited and ARK generation hook works.
+afs.tag_subject_of(('SEDAArchiveUnit', 'seda_archive_unit', '*'), 'main', 'attributes')
+# Though we don't want to see the field in form, so hide the widget.
+affk.set_field_kwargs('SEDAArchiveUnit', 'seda_archive_unit', widget=fw.HiddenInput())
+
 
 archivetransfer.ArchiveTransferTabbedPrimaryView.tabs.append('saem.lifecycle_tab')
 



More information about the saem-devel mailing list