{% extends "flask_deck/base.html" %} {% block breadcrumbs %} / {{ view.plural_label }} / Dry-Run Import {% endblock %} {% block content %}

Import {{ view.plural_label }}

Every upload is validated inside a guaranteed-rollback SQLAlchemy SAVEPOINT before commit.

{{ deck_icon("arrow-left", 13) }} Back to {{ view.plural_label }}
{% if error_msg %} {% endif %}

Step 1 · Upload CSV, JSON, or XLSX

Max {{ config.max_import_rows }} rows · {{ config.max_upload_bytes // (1024 * 1024) }} MiB
{% if mapping_ctx %}

Column Mapping · {{ mapping_ctx.filename }}

Match uploaded headers to writable {{ view.label }} fields

{% for hdr in mapping_ctx.headers %} {% endfor %}
Uploaded Column Sample Values Target Field
{{ hdr }} {% for sr in mapping_ctx.sample_rows %}{{ sr.get(hdr, '') }}{% if not loop.last %} · {% endif %}{% endfor %}
{% endif %} {% if report %} {% set demo_lock_message = "CSV/JSON/XLSX parsing, column mapping, and SQLAlchemy SAVEPOINT Dry-Run Diff validation work live, while committing rows to the database is disabled in public Demo Safe Mode." %} {% include "flask_deck/partials/demo_lock_banner.html" %}
Creates (+INSERT)
{{ report.creates }}
Updates (~DIFF)
{{ report.updates }}
Unchanged (=SKIP)
{{ report.unchanged }}
Validation Errors
{{ report.errors }}

Step 2 · Savepoint Diff Preview ({{ report.filename }})

Mapped columns: {{ report.mapped_columns | length }} · Zero changes written to DB yet

{% if report.errors > 0 %} {{ deck_icon("download", 12) }} Download Failed Rows CSV {% endif %} {% if report.applicable_count > 0 %}
{% if report.errors > 0 %} {% endif %} {% if can_view_jobs %} {% endif %}
{% endif %}
{% for row in report.rows[:200] %} {% endfor %}
Row Action Key Field-Level Diff / Diagnostics
#{{ row.row_number }} {% if row.status == 'create' %} + INSERT {% elif row.status == 'update' %} ~ UPDATE {% elif row.status == 'error' %} ! ERROR {% else %} = UNCHANGED {% endif %} {{ row.key_display }} {% if row.errors %}
{{ row.errors | join(" · ") }}
{% elif row.changes %}
{% for fname, pair in row.changes.items() %}
{{ fname }}: {% if pair[0] is not none %}{{ pair[0] }}→{% endif %} {{ pair[1] }}
{% endfor %}
{% else %} Identical to existing record {% endif %}
{% endif %}
{% endblock %} {% block extra_scripts %} {% endblock %}