Skip to content

Changelog

Unreleased

Every PR that changes src/kloudmint/ adds its line here (what changed, and what hand-written code it lets a client delete). At release time these move under the new version heading.

0.6.4

Added

  • export_requires_selection (opt-in, with tracked exports): Kloudmint(..., export_requires_selection=True) makes Export work only on ticked rows. The button is greyed out ("Export (select rows)") until rows are ticked, and the server refuses an export request without a selection (400, before anything is recorded), so typing the URL does not bypass it. Replaces custom code that stops users exporting a whole table. See Exports.md.
  • Selection survives pagination, plus "Select all matching rows" (tracked exports): rows ticked on one page stay ticked while you page, search-sort or filter back and forth (kept in the browser per list, search and filter), with a bar showing the count and a Clear selection link. Ticking the header box offers Select all N matching rows, which exports the whole filtered list (select_all=1) and also satisfies export_requires_selection. Replaces custom JavaScript that kept selections across pages.

0.6.3

Fixed

  • Export now exports the ticked rows (with tracked exports on). SQLAdmin's Export links carried no selection, so ticking rows and clicking Export still exported every row. The links now carry the ticked row ids and the button reads "Export (N selected)"; with nothing ticked it exports every row matching the current search and filters, as before. The selection narrows the view's own query and filters (it cannot reach rows outside them), works for CSV, JSON, XLSX, composite primary keys and background exports, and is stored in the export record. A malformed selection, or more than 1000 ids, is a 400. Projects without tracked exports are unchanged. See Exports.md.

0.6.2

Added

  • Tracked exports (opt-in): Kloudmint(file_export_model=, require_export_permission=, export_max_rows=) with create_file_export_model(Base) and FileExportAdminBase. Adds an export permission (a column in the role permission grid), a record of every export (who, which resource, exact filters, rows, success or failure and why), a read-only Exports screen where users see only their own (the all permission shows everyone's), and makes export match the list on screen: search, SQLAdmin filters and sort are applied, the Export links carry the page's query string, and the button is hidden from roles without export. Replaces hand-written export gating and export logging. Needs an Alembic migration for the new table and a synchronous engine. With none of the options a project behaves exactly as before. See Exports.md.

  • Background exports (opt-in, builds on tracked exports): Kloudmint(export_background=ExportBackground(threshold=...)). An export of more rows than the threshold is queued; the user lands on the Exports screen, a job writes the file in batches as that user (permission re-checked), stores it through your storage backend, and the user downloads it from the Exports screen through an authenticated route. Files expire (expires_days) and purge_expired(admin) deletes them; a dead worker's export is marked failed; an optional notify hook runs on success. Runners: ThreadRunner (default), CeleryRunner(task), or your own. Replaces exports that time out on big tables and hand-built "email me a link" jobs. Small exports are unchanged.

  • Excel (xlsx) export: opt-in per view with export_types = ["csv", "json", "xlsx"] and the new optional extra pip install kloudmint[xlsx] (openpyxl). Works for instant and background exports.
  • LocalStorage and S3Storage gain optional upload_path(path, filename) (no whole-file read into memory); LocalStorage gains local_path(key).

Changed

  • kloudmint scaffold skips the new FileExport model and points to FileExportAdminBase.

0.6.1

Added

  • kloudmint scaffold (new kloudmint command): reads your SQLAlchemy models and writes a first-draft admin views.py -- ChildOf / Related for owned child tables, SoftDeleteMixin for deleted_at, search columns, default sort, and GENERATED_VIEWS / RESOURCES lists to register and seed. Sensitive columns (passwords, tokens, ...) are left out; anything it can't decide safely becomes a # TODO. Preview by default, --write to create the file, never overwrites. Replaces hand-writing the 70% of a new project's views.py that is lists, search and parent/child wiring. See Scaffold.md.

Fixed

  • ChildOf.parent_fk now accepts the column name (parent_fk = "creator_id"). The previously documented form, a column object (parent_fk = Job.creator_id), crashed view registration with UnmappedInstanceError, so a model with two foreign keys to the same parent could not use ChildOf at all.
  • ChildOf now joins the parent along the chosen relationship in its list/count queries (used to hide children of soft-deleted parents). It joined the bare table, which SQLAlchemy rejects with AmbiguousForeignKeysError when the child has two foreign keys to the same parent.

0.5.0

Added

  • Capabilities.md: one page listing everything kloudmint can do, by behaviour (permission grid, protected roles, "a user can't delete themselves", soft delete, uploads, audit, ...), with the hand-written code each feature replaces and the version it arrived in. Generated from _docs/features.json by scripts/docs_tools.py; tests fail if it, the feature list or the docs fall out of step with the code.
  • Docs bundled in the wheel (kloudmint/_docs/: the guides, Capabilities.md, features.json, CHANGELOG.md), so an AI assistant or a developer can read the docs for exactly the installed version from site-packages. ReleaseProcedure.md is deliberately not included.
  • Docs site (MkDocs Material on GitHub Pages) with llms.txt / llms-full.txt.

Changed

  • requires-python is now >=3.10 (was >=3.9). import kloudmint already failed on 3.9 (relations.py evaluates X | None at import time), so this only makes the declared floor honest: pip now refuses to install it on 3.9 instead of installing something that cannot be imported. Projects still on 3.9 must stay on a release that supports it or upgrade Python.

Fixed

  • Depend on sqlalchemy[asyncio] (adds greenlet). With SQLAlchemy 2.1 a fresh install failed on import kloudmint because sqladmin needs greenlet at import time.

0.4.2

Merge of staging tag v0.4.1 with related-records building blocks (0.4.0).

Added

  • Everything in 0.4.0 and 0.4.1 below, combined on one branch.
  • ChildOf "New" button script preserved in the merged layout.html.

0.4.1

Tagged release on staging (v0.4.1).

Added

  • List UI: overridden layout.html, list.html, and _macros.html for breadcrumbs, page title bar, pinned sidebar logout, and client-side per-column header filters (cf_<column>=<text>).
  • Column filters: column_filters.py with automatic RBACModelView.list_query() integration and auto-sortable plain columns in RBACModelView.__init__.

Changed

  • Sidebar/list-table polish: dedupe single-segment breadcrumb, fix collapsed-sidebar content gap, column show/hide toggle, lighter header/selected-row colors, darker sidebar, tighter column widths and row height, selected-row link contrast fix.

0.4.0

Added

  • Related records: ChildOf, Related, RelatedRecordsMixin for parent/child admin tables with multi-select parent filters, related links (optional counts) on the parent list, single-id parent prefill on create, and Save redirect back to a filtered list (sqladmin 0.31 query preservation + layout "New" button script).
  • Custom page RBAC: RBACBaseView with automatic is_accessible / is_visible gating and Kloudmint.register() support; get_all_actions() for permission grid extras like use.
  • Filters: MultiSelectForeignKeyFilter, MultiSelectValueFilter, ExactValueFilter with kloudmint filter templates.
  • Mixins: SoftDeleteMixin, DynamicChoicesMixin, FileUploadMixin + FileSpec.
  • Storage: StorageBackend protocol, LocalStorage, S3Storage (optional s3 extra); Kloudmint(..., storage=) propagates to upload mixins.
  • Formatters: kloudmint.formatters factories (badge, bool_badge, date, pre, json_pretty, link, action_links, file_preview, expiry_badge).
  • Audit: create_activity_log_model, KloudmintAuditBackend, AuditDiffMixin, ActivityLogAdminBase.
  • Detail pages: DetailPage, Section, auto-mounted from detail_pages= on a model view.
  • Engine: hide_empty_categories, audit_backend, activity_log_model; register() handles RBACBaseView and detail pages.
  • Docs: docs/BuildingBlocks.md.

Changed

  • Requires sqladmin>=0.31,<0.32 (was >=0.16.0).
  • RelatedRecordsMixin.get_list_value is async (matches sqladmin 0.31 async templates).
  • AuditDiffMixin.after_model_change returns super()'s result (preserves future redirect hooks).
  • Sidebar empty categories are hidden by default (hide_empty_categories=True).

Known limitations

  • ChildOf does not prefill when the filter query carries multiple ids.
  • "Save and add another" on a filtered child create opens an unfiltered create form.
  • can_export still cannot be gated per-role (sqladmin has no async export hook).