Skip to content

Support Django inlines (TabularInline / StackedInline) in detail view and writes #54

@MartinCastroAlvarez

Description

@MartinCastroAlvarez

Summary

Django's TabularInline and StackedInline are first-class admin primitives. Any non-trivial admin uses them for parent/child relationships (orders → line items, posts → comments, invoices → entries, etc.). The current SPA does not render or accept inlines at all — a registered ModelAdmin.inlines list is silently ignored.

Why this matters

For a Django shop migrating off the HTML admin, the inline editor is usually the single highest-traffic UI surface. Without it, the SPA isn't a viable replacement for the legacy admin on most models — only the simplest leaf models work.

What I expect as a consumer

  • The GET /api/v1/<app>/<model>/<pk>/ payload should surface a top-level inlines: [] array describing each InlineModelAdmin the parent declares (fk_name, child model, fields, permissions, fieldsets, ordering, extra, min_num, max_num, can_delete).
  • The SPA should render each inline as a repeatable form section (Tabular = table layout, Stacked = card layout) under the parent form.
  • Writes should round-trip via formsets — i.e. the API should accept a partial inline payload and the package should run ModelAdmin's formset through is_valid() / save() the same way change_view does today, preserving clean() hooks and signals.
  • has_*_permission(request, obj=parent) on each InlineModelAdmin should gate read/add/change/delete independently of the parent.

Out of scope for a first cut

  • Nested inlines (inline-of-inline). Useful but rare.
  • GenericInlineModelAdmin (contenttypes). Worth a follow-up.

Acceptance signal

A consumer can register a ModelAdmin with two inlines (one TabularInline, one StackedInline), and the SPA shows, edits, validates, and saves the parent + children in a single request without the consumer writing any frontend code.

Workaround today

There is none — inlines are simply absent.

— posted from a production Django integration pilot

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestparityDjango admin parity gap (tracked in #147)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions