Hide compressed/version elements from data-object of simplified profiles
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 26 Aug 2016 08:55:52 +0200
changeset 1577 946cd9fa7dde
parent 1576 370df5f16508
child 1578 c0e49ad09701
Hide compressed/version elements from data-object of simplified profiles
views/dataobject.py
--- a/views/dataobject.py	Fri Aug 26 09:05:03 2016 +0200
+++ b/views/dataobject.py	Fri Aug 26 08:55:52 2016 +0200
@@ -27,9 +27,9 @@
 from cubes.skos.views import widgets as skos
 
 from cubes.seda.xsd2yams import RDEF_CONSTRAINTS
-from cubes.seda.entities import parent_and_container
+from cubes.seda.entities import parent_and_container, simplified_profile
 from cubes.seda.views import rtags_from_xsd_element, add_subobject_link
-from cubes.seda.views import viewlib
+from cubes.seda.views import viewlib, copy_rtag
 from cubes.seda.views import uicfg as sedauicfg  # noqa - ensure those rules are defined first
 
 
@@ -101,6 +101,11 @@
                     'label': _('referenced by:')})
 
 pvs.tag_object_of(('*', 'seda_target', '*'), 'hidden')  # in the relationship tab
+
+simplified_pvs = copy_rtag(pvs, __name__,
+                           is_instance('SEDABinaryDataObject') & simplified_profile())
+simplified_pvs.tag_object_of(('*', 'seda_data_object_reference_id', '*'), 'hidden')
+
 for rtype in ('seda_compressed', 'seda_data_object_version_from'):
     # hide relation from autoform because of limitation of _container_eid
     afs.tag_object_of(('*', rtype, '*'), 'main', 'hidden')
@@ -108,6 +113,7 @@
     rec.tag_object_of(('*', rtype, '*'),
                       {'rvid': 'seda.reledit.complexlink',
                        'novalue_label': _('<unauthorized>')})
+    simplified_pvs.tag_object_of(('*', rtype, '*'), 'hidden')
 
 rec.tag_subject_of(('SEDABinaryDataObject', 'seda_alt_binary_data_object_attachment', '*'),
                    {'rvid': 'seda.reledit.alternative',