{% if form_data.get(id_prefix+'_oid') %} {% set selected_id = form_data[id_prefix+'_oid'] %} {% elif data is not none and "object_id" in data %} {% if "component_uuid" in data and data.component_uuid is not none %} {% set sel = namespace(selected_id=None) %} {% for obj in referencable_objects %} {% if obj.fed_object_id == data["object_id"] and obj.component.uuid == data["component_uuid"] %} {% set sel.selected_id = obj.object_id %} {% endif %} {% endfor %} {% set selected_id = sel.selected_id | string %} {% else %} {% set selected_id = data.object_id | string %} {% endif %} {% else %} {% set selected_id = none %} {% endif %} {% if schema_action_ids is none and schema_action_type_ids is none %} {% set valid_action_ids = none %} {% else %} {% set valid_action_ids = [] %} {% for action_id in action_type_id_by_action_id %} {% if schema_action_ids is none or action_id in schema_action_ids %} {% if schema_action_type_ids is none or action_type_id_by_action_id[action_id] in schema_action_type_ids %} {{ valid_action_ids.append(action_id) or '' }} {% endif %} {% endif %} {% endfor %} {% endif %} {% if config['USE_TYPEAHEAD_FOR_OBJECTS'] %}