37 lines
1.1 KiB
Python
37 lines
1.1 KiB
Python
def specification(req_spec):
|
|
req_spec.add_title({{ data.titel|tojson }})
|
|
{% set sec = namespace(cnt = 1) %}
|
|
{%- for uid in data.uid_list_sorted %}
|
|
{%- with item=data.item_dict[uid] %}
|
|
{%- if item.system_type_uid == '_4-K5EHYYEem_kd-7nxt1sg' %}
|
|
#
|
|
# Section
|
|
#
|
|
sec_uuid = req_spec.add(
|
|
itemtype="SEC",
|
|
id={{ sec.cnt }},
|
|
{%- set sec.cnt = sec.cnt + 1 %}
|
|
heading={{ item.Heading|tojson }},
|
|
)
|
|
{%- elif item.system_type_uid == '_MR7eNHYYEem_kd-7nxt1sg' %}
|
|
|
|
# Requirement
|
|
req_spec.add(
|
|
parent=sec_uuid,
|
|
itemtype="REQ",
|
|
id={{ item.ID[4:]}},
|
|
heading={{ item.Heading|tojson }},
|
|
{%- if 'Description' in item and item.Description != '' %}
|
|
description={{ item.Description|tojson }},
|
|
{%- if 'ReasonForImplementation' in item and item.ReasonForImplementation != '' %}
|
|
reason={{ item.ReasonForImplementation|tojson }},
|
|
{%- endif %}
|
|
{%- if 'Fitcriterion' in item and item.Fitcriterion != '' %}
|
|
fitcriterion={{ item.Fitcriterion|tojson }},
|
|
{%- endif %}
|
|
{%- endif %}
|
|
)
|
|
{%- endif %}
|
|
{%- endwith %}
|
|
{%- endfor %}
|