What this prompt does
This prompt turns the Django admin into an internal operations dashboard for a [project_type], focused on [admin_models]. For the [primary_model] it builds a ModelAdmin with list_display showing [list_columns] (including colored status badges via format_html), list_filter on [filter_fields] with a custom date-range filter, search_fields on [search_fields], and list_editable for [editable_fields].
Beyond the list view it adds TabularInline editing for [inline_models] with extra=0, a min_num of [min_inline], and widget overrides from [widget_overrides], custom bulk actions ([bulk_actions]) with confirmation pages for destructive ones, and a custom admin view named [custom_view_name] showing [custom_view_content]. It overrides change_form_template for [form_customizations] like dependent dropdowns and auto-calculated fields, integrates [import_export_lib] for [importable_models] with validation and error reporting, and enforces role-based access for [admin_roles] with fieldsets that show or hide fields by group and get_queryset filtering per [visibility_rules]. The end result is an admin that operations staff can run their day from rather than a bare CRUD scaffold.
When to use it
- A client's operations team will live in the admin daily and needs it genuinely usable
- You want at-a-glance status via colored badges and humanized columns
- You need inline editing of related rows (order items, payment attempts) on one page
- You want bulk actions like mark-as-shipped or export-to-CSV with safe confirmations
- You need CSV/Excel import-export with validation and error reporting
- Different roles must see different fields and only their own scoped records
- You'd rather extend the admin than build a separate internal tool from scratch
Example output
The AI returns ModelAdmin classes with format_html badge methods, inline classes with extra=0 and widget overrides, action functions with confirmation templates, a custom AdminSite view for [custom_view_name], a change_form_template override with inline JavaScript for dependent fields, [import_export_lib] resource classes, and role-based get_fieldsets/get_queryset overrides. Expect organized code blocks per numbered feature so you can pull in just the inlines, actions, or role logic you need.
Pro tips
- Keep
list_editablefields in[editable_fields]minimal — making too many columns editable inline invites accidental edits - Add a confirmation page for every destructive entry in
[bulk_actions], especially deletes and status changes that fan out side effects - Use
[widget_overrides](like Select2 for product pickers) so large foreign-key lists stay usable - Scope
get_querysetby[visibility_rules]so roles like operations or support never see records outside their region or assignment - Build the
[custom_view_name]page as a proper AdminSite view with permission checks, not an unprotected URL - Validate imports for
[importable_models]so a malformed row reports a clear error instead of partially loading - Add a date-range filter on
[filter_fields]so operators can slice records by period without writing a query - If badges render as escaped HTML, confirm the method returns
format_html(...)and is listed inlist_display