[CORD-2232] Removing feedback state from model that does not have synchronizers

Change-Id: If6b1513ee7baf48fc0273719d6c69449dd55fa2e
diff --git a/lib/xos-genx/xosgenx/jinja2_extensions/base.py b/lib/xos-genx/xosgenx/jinja2_extensions/base.py
index 93f4581..d3982f1 100644
--- a/lib/xos-genx/xosgenx/jinja2_extensions/base.py
+++ b/lib/xos-genx/xosgenx/jinja2_extensions/base.py
@@ -124,6 +124,12 @@
             fields.extend(base_fields)
             fields.extend(model_fields)
 
+    if 'no_sync' in m['options'] and m['options']['no_sync']:
+        fields = [f for f in fields if f['name'] != 'backend_status' and f['name'] != 'backend_code']
+
+    if 'no_policy' in m['options'] and m['options']['no_policy']:
+        fields = [f for f in fields if f['name'] != 'policy_status' and f['name'] != 'policy_code']
+
     return fields
 
 def xproto_base_rlinks(m, table):
diff --git a/lib/xos-genx/xosgenx/targets/django.xtarget b/lib/xos-genx/xosgenx/targets/django.xtarget
index 1c8ce93..ca81240 100644
--- a/lib/xos-genx/xosgenx/targets/django.xtarget
+++ b/lib/xos-genx/xosgenx/targets/django.xtarget
@@ -27,6 +27,19 @@
 class {{ m.name }}{{ xproto_base_def(m.name, m.bases) }}:
   plural_name = "{{ xproto_pluralize(m) }}"
 
+{#  {% if m.options.no_sync or m.options.no_policy %}#}
+{#  {% if m.options.no_sync -%}#}
+{#  # Removing synchronizer feedback state from model#}
+{#  backend_status = None#}
+{#  backend_code = None#}
+{#  {%- endif %}#}
+{#  {% if m.options.no_policy -%}#}
+{#  # Removing model policy feedback state from model#}
+{#  policy_code = None#}
+{#  policy_status = None#}
+{#  {%- endif %}#}
+{#  {% endif %}#}
+
   # Primitive Fields (Not Relations)
   {% for f in m.fields %}
   {%- if not f.link -%}