[CORD-1538] Hiding model/fields from xProto
Change-Id: I25ecfe1ce860e561ea2f9c7ce8eeecdcd9e8e3c4
diff --git a/lib/xos-genx/xosgenx/targets/modeldefs.xtarget b/lib/xos-genx/xosgenx/targets/modeldefs.xtarget
index 23a1de1..8c4771f 100644
--- a/lib/xos-genx/xosgenx/targets/modeldefs.xtarget
+++ b/lib/xos-genx/xosgenx/targets/modeldefs.xtarget
@@ -1,11 +1,11 @@
items:
{%- for m in proto.messages | sort(attribute='name') %}
-{%- if m.name != 'XOSBase' %}
+{%- if m.name != 'XOSBase' and xproto_unquote(xproto_first_non_empty([m.options.gui_hidden, 'False'])) != 'True' %}
- app: {{ xproto_unquote(xproto_first_non_empty([m.options.name, m.options.app_label, options.name, context.app_label])) }}
fields:
{%- set id_field = {'type':'int32', 'name':'id', 'options':{}} %}
{% for f in (xproto_base_fields(m, proto.message_table) + m.fields + [id_field]) | sort(attribute='name') -%}
- {% if not f.link or f.options.link_type != 'manytomany' -%}
+ {% if xproto_unquote(xproto_first_non_empty([f.options.gui_hidden, 'False'])) != 'True' and (not f.link or f.options.link_type != 'manytomany') -%}
- hint: {% if f.options.help_text %}{{ xproto_unquote(f.options.help_text) }}{% else %}''{% endif %}
{% if not f.link -%}
name: {{ f.name }}