Skip to main content

tungsten-quick-create

Quick Create plugin for Tungsten, the admin panel for FastAPI.

A + New button in the top bar. Pick what you want to add (a product, a lead, a ticket, an employee, an invoice...) and its form opens in a side panel, on top of the page you are on. Save, and you are still where you were.

What you get

  • A + New button on every page, listing every resource the signed-in user may create.
  • Works with other plugins out of the box: leads, tickets, HR, finance, blog and your own resources all show up.
  • Respects permissions: a user only sees what they may create (roles, policies and tenants).
  • The form opens in a side panel (or a popup) with live fields, uploads and validation, like the normal create page.
  • Create & create another for adding many records in a row.
  • After saving: a toast with an Open link to the new record, and any table on the page refreshes.
  • Grouped by sidebar group, with a search box when the list is long.
  • Optional keyboard shortcut.
  • Safe: a database error or a broken policy shows a message and never breaks the page.

Install

pip install tungsten-quick-create
from tungsten_quick_create import QuickCreatePlugin

panel.plugin(QuickCreatePlugin())

No tables, no settings needed.

Options

QuickCreatePlugin(
    include=None,             # only these resources (classes or slugs), in this order
    exclude=(),               # hide these resources (classes or slugs)
    label="New",              # "" shows just the + icon
    icon="plus",
    slide_over=True,          # False: a centred popup
    width="4xl",              # sm, md, lg, xl, 2xl, 3xl, 4xl, 5xl
    create_another=True,      # the "Create & create another" button
    open_after_create=False,  # True: go to the new record after saving
    group=True,               # split the menu by sidebar group
    search_from=8,            # show a search box once the menu has this many entries
    shortcut=None,            # e.g. "mod+shift+n" (mod is Ctrl, or Cmd on a Mac)
)

Hide one resource

class AuditLogResource(Resource):
    quick_create = False

Resources without a create page (pages = ("index",)) never show up.

Add your own entries (for plugin authors)

Anything that is not a resource form can be a link in the menu:

quick = panel.get_plugin("quick-create")
if quick is not None:
    quick.add_link("event", "Event", "/admin/calendar?new=1", icon="calendar", group="Planning")
    quick.add_link("upload", "Upload file", lambda ctx: ctx.url("media", "upload"), icon="upload",
                   visible=lambda user: user.is_staff)

The same key replaces an entry; quick.remove_link("event") removes it.

Try it

pip install -e . -e plugins/quick-create uvicorn
uvicorn plugins.quick-create.example:app --reload   # from the repo root

Open http://127.0.0.1:8000/admin and sign in with admin@example.com / password.

License

MIT

Metadata

Release files for tungsten-quick-create 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tungsten-quick-create 0.1.0
File Size Uploaded
tungsten_quick_create-0.1.0.tar.gz 12.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tungsten-quick-create 0.1.0
File Interpreter ABI Platform
tungsten_quick_create-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.4 kB

Release files / tungsten_quick_create-0.1.0.tar.gz

Download URL tungsten_quick_create-0.1.0.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4fb2fe6cbabf303f1b3b7fa62e5b8268b7c1d8d1913579bb5e1dc19c32c7ea37
BLAKE2b-256 checksum
How to use checksums
626d98b8a1123a4bb161596df30667a3e1fff38936480f8294c083285570cae3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / tungsten_quick_create-0.1.0-py3-none-any.whl

Download URL tungsten_quick_create-0.1.0-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
93b0473e8a3d8122a772d76aa1943a18c7f457b6368e62f55523ccf534a93a2f
BLAKE2b-256 checksum
How to use checksums
d0823e154d89b42116484f7f79015756af214607ee87695932c7ebe9ad03873b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page