Extension points¶
The contract for extending Conjure without forking. Each extension point is a public registry or hook; you add capabilities by registering, never by patching the core.
The extension points¶
| Extension point | What you add | How | Status |
|---|---|---|---|
| Field type renderer | Custom field / GFK / GIS display & input | @register_field("MyField") โ backend schema + frontend renderer pair |
๐ก |
| Widget | Dashboard card / chart | @register_widget("name") + frontend widget component |
โ |
| Action | Export, issue, send, refund | ADMIN_ACTIONS declaration + sync_admin_actions (permission) + handler |
๐ |
AdminConfig attribute |
Per-model behaviour | Declare on the registered config class | โ |
| Page eject | Fully custom screen | Runtime โ codegen .tsx, then own it |
โ |
Each extension point is documented with an example here and in the relevant guide, so the "how to add a feature" path stays current with the code.
Field type renderer¶
Register both halves โ the backend describes the field in the schema; the frontend renders it. Without the pair, the field shows as raw text.
Widget¶
from conjure import register_widget
@register_widget("revenue-trend")
def revenue_trend(request):
qs = Order.objects.filter(status="paid")
return {"series": monthly_totals(qs)}
const data = useQuery(queryKeys.widget("revenue-trend"),
() => adminApi.widget("revenue-trend"));
// render with Recharts
Served at GET /conjure/widgets/revenue-trend/. See the
REST API reference.
Action¶
๐ Three pieces โ declaration, permission sync, handler:
ADMIN_ACTIONS = [
{"model": "order.Order", "codename": "refund", "name": "Refund",
"kind": "server", "scope": "bulk", "variant": "danger", "confirm": "Refund selected orders?"},
]
The handler (dispatched by codename on POST /conjure/r/order.Order/action/refund/)
performs the refund, returns a partial-failure report, and writes an audit entry. Full
design: Actions & permissions.
AdminConfig attributes¶
The everyday extension point โ already available. Curate list/form/inline behaviour per model. See Registering models for the full attribute set.
Page eject¶
Pull a runtime-rendered page into codegen you own:
graph LR
A["GenericModelPage ๐"] -->|eject| B["pages/{model}/*.tsx"]
B --> C["edit ยท // @custom preserved on regen"]
See Custom pages.
Contributing a new extension point¶
If you're adding a new kind of hook to Conjure itself (not just using one), see Extension development for the registry conventions, the backend/frontend pairing rule, and the docs-with-example requirement.