Reintroduce code list version for simplified profiles, but restrict elements to those making sense in that case
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 26 Aug 2016 13:22:24 +0200
changeset 1590 02191db60b85
parent 1589 684686c36fe7
child 1591 f25981e6eb67
Reintroduce code list version for simplified profiles, but restrict elements to those making sense in that case
views/archivetransfer.py
--- a/views/archivetransfer.py	Fri Aug 26 12:00:58 2016 +0200
+++ b/views/archivetransfer.py	Fri Aug 26 13:22:24 2016 +0200
@@ -89,11 +89,27 @@
 class ArchiveTransferCodeListVersionsTab(tabs.PrimaryTab):
     """Tab for code list versions information of an archive transfer."""
     __regid__ = 'seda_at_code_list_versions_tab'
-    __select__ = (tabs.PrimaryTab.__select__
-                  & is_instance('SEDAArchiveTransfer')
-                  & full_seda2_profile())
+    __select__ = is_instance('SEDAArchiveTransfer')
+
+    rsection, display_ctrl = rtags_from_xsd_element('SEDAArchiveTransfer', 'CodeListVersions')
+
+
+class SimplifiedArchiveTransferCodeListVersionsTab(ArchiveTransferCodeListVersionsTab):
+
+    __select__ = ArchiveTransferCodeListVersionsTab.__select__ & simplified_profile()
 
     rsection, display_ctrl = rtags_from_xsd_element('SEDAArchiveTransfer', 'CodeListVersions')
+    for rtype in ('seda_reply_code_list_version',
+                  'seda_file_format_code_list_version',):
+        rsection.tag_subject_of(('SEDAArchiveTransfer', rtype, '*'), 'hidden')
+    for rtype in ('seda_classification_rule_code_list_version_from',
+                  'seda_data_object_version_code_list_version_from',
+                  'seda_compression_algorithm_code_list_version_from',
+                  'seda_storage_rule_code_list_version_from',
+                  'seda_dissemination_rule_code_list_version_from',
+                  'seda_reuse_rule_code_list_version_from',
+                  'seda_relationship_code_list_version_from'):
+        rsection.tag_object_of(('*', rtype, 'SEDAArchiveTransfer'), 'hidden')
 
 
 class ArchiveTransferManagementTab(tabs.PrimaryTab):