{% load i18n dbvalue humanize %}{% comment %}Table detail. Subtabs (Columns | Indexes | Data | Danger) keep the panel a clean read-only view; every mutation happens in the shared right drawer or, for one-click destructive ops, behind an hx-confirm. `drawer` holds the open form's kind; `ctx` carries the row the drawer is acting on. Submits target #detail, so the whole panel (drawer included) re-renders and resets.{% endcomment %} {% comment %}既定タブは Data ── テーブル名を押した人が見たいのは中身で、列の構成は 自分で書いたので知っている。 ただし**同じテーブルの中で操作したときは、いま見ていたタブに留まる**。この panel は htmx で丸ごと差し替わるので、素朴に書くと列を 1 つ直すたびに Data へ弾き飛ばされる。 直前に見ていたタブをテーブル名つきで覚えておき、同じテーブルなら戻す(別のテーブルへ 移ったら Data から始める)。 ⚠️ 注釈は**タグの外**に置くこと。属性の中に書いた `{#…#}` は Django に解釈されず、 そのまま画面へ出る(2026-09-04 に 2 か所やらかした)。{% endcomment %}
| {% trans "Name" %} | {% trans "Type" %} | {% trans "Nullable" %} | {% trans "Default" %} | |
|---|---|---|---|---|
|
{{ col.name }}
{% if col.comment %} {{ col.comment }} {% endif %}
|
{{ col.type }} | {% if col.nullable %}{% trans "yes" %}{% else %}{% trans "no" %}{% endif %} | {% if col.generated %} {% trans "generated" %} · {{ col.generated }} {% if col.generation_expr %}{{ col.generation_expr }}{% endif %} {% else %} {{ col.default|default:"—" }} {% endif %} |
{% if jsonb_shape_supported and col.type == 'jsonb' or jsonb_shape_supported and col.type == 'json' %}
{% endif %}
|
| {% trans "Name" %} | {% trans "Columns" %} | {% trans "Method" %} | {% trans "Size" %} | |
|---|---|---|---|---|
| {{ ix.name }} {% if ix.primary %}{% trans "primary" %} {% elif ix.unique %}{% trans "unique" %}{% endif %} {% if not ix.valid %}{% trans "invalid" %}{% endif %} | {{ ix.columns_text }} | {{ ix.method }} | {{ ix.size|default:"—" }} | {% if ix.primary %} {% trans "pk" %} {% else %} {% endif %} |
{% trans "No indexes on this table yet." %}
{% endif %}| {{ name }}{{ type }} | {% endfor %}
|---|
| {{ v|cell }} | {% endfor %}
{% trans "This table is empty." %}
{% endif %}{% trans "Truncate table" %}
{% trans "Delete every row. A safety snapshot is taken first." %}
{% trans "Drop table" %}
{% trans "Remove the table and all its data. A safety snapshot is taken first." %}