From 5710ab1d8f351b8251ec84bafffe413b6eaebb2c Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 12 Jul 2024 11:27:18 +1200 Subject: [PATCH] Update dataclass_avro.py.jinja --- mdg/templates/Python/dataclass_avro.py.jinja | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/mdg/templates/Python/dataclass_avro.py.jinja b/mdg/templates/Python/dataclass_avro.py.jinja index 5ad1c7a..7cc44a0 100644 --- a/mdg/templates/Python/dataclass_avro.py.jinja +++ b/mdg/templates/Python/dataclass_avro.py.jinja @@ -40,7 +40,7 @@ class {{ current_class.name | case_class }}({% if current_class.generalization % namespace = "customer_core.{{ current_class.package.name | snakecase }}" {% endmacro -%} - +{% for cls in package.classes %} {% for attr in cls.attributes %}{% if attr.classification %} {{ do_enum(attr.classification) }} {% endif %}{% endfor %}{% for assoc in cls.associations_to %}{% for attr in assoc.source.attributes %}{% if attr.classification %} @@ -50,12 +50,5 @@ class {{ current_class.name | case_class }}({% if current_class.generalization % {{ do_enum(attr.classification) }} {% endif %}{% endfor %}{% endif %} -{% for assoc in cls.associations_to %}{% if assoc.association_type.name in ['AGGREGATION', 'COMPOSITION', 'ASSOCIATION'] and "aggregate root" not in assoc.source.stereotypes -%} -{{ do_class(assoc.source) }} -{% endif %}{% endfor -%} - -{% if cls.generalization %}{{ do_class(cls.generalization) }}{% endif %} {{ do_class(cls, True) }} -{% for specialization in cls.specialized_by %}{% if "aggregate root" not in specialization.stereotypes %}{{ do_class(specialization) }} -{% endif %}{% endfor -%} - +{% endfor %}