Commit d8eff697 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

[ui] Generate rules for seda_relationship automatically

parent 6ae346cc2636
......@@ -114,9 +114,6 @@ for etype in ('SEDABinaryDataObject', 'SEDAPhysicalDataObject'):
rec.tag_object_of(('*', 'seda_data_object_version_from', etype),
{'rvid': 'seda.reledit.complexlink',
'novalue_label': _('<unauthorized>')})
# in its own tab
afs.tag_object_of(('*', 'seda_relationship', etype), 'main', 'hidden')
pvs.tag_object_of(('*', 'seda_relationship', etype), 'hidden')
def uri_cardinality_vocabulary(form, field):
......
......@@ -903,7 +903,7 @@ afs.tag_object_of(('*', 'seda_custodial_history_file', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_when', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_when', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_relationship', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_relationship', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_relationship', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_data_object_version_from', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_data_object_version_from', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_data_object_version_to', '*'), 'main', 'hidden')
......@@ -1025,6 +1025,8 @@ pvs.tag_subject_of(('*', 'seda_binary_data_object', '*'), 'hidden')
pvs.tag_object_of(('*', 'seda_binary_data_object', '*'), 'hidden')
pvs.tag_subject_of(('*', 'seda_physical_data_object', '*'), 'hidden')
pvs.tag_object_of(('*', 'seda_physical_data_object', '*'), 'hidden')
pvs.tag_subject_of(('*', 'seda_relationship', '*'), 'hidden')
pvs.tag_object_of(('*', 'seda_relationship', '*'), 'hidden')
pvs.tag_subject_of(('*', 'seda_creating_application_name', '*'), 'hidden')
pvs.tag_object_of(('*', 'seda_creating_application_name', '*'), 'hidden')
pvs.tag_subject_of(('*', 'seda_creating_application_version', '*'), 'hidden')
......
......@@ -31,6 +31,7 @@ LEVEL_ETYPES = set(('SEDABinaryDataObjectType', 'SEDAPhysicalDataObjectType',
RTYPES_IN_TAB = set((
'seda_binary_data_object',
'seda_physical_data_object',
'seda_relationship',
))
for element_name in ('CodeListVersions', 'FormatIdentification', 'FileInfo'):
for rtype, role, path in XSDM_MAPPING.iter_rtype_role(element_name):
......@@ -121,6 +122,9 @@ class UICFGGenerator(CodeGenerator):
yield mapping.rtype, 'subject', {'label': 'value'}
def primaryview_section_for_rdef_mapping(self, mapping):
if ('pvs', mapping.rtype) in self._processed:
return
self._processed.add(('pvs', mapping.rtype))
if mapping.rtype in RTYPES_IN_TAB:
section = 'hidden'
role = mapping.composite or 'subject'
......
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