Composants → bpm.crud

bpm.crud

Page CRUD (liste, formulaire, colonnes, champs, endpoint).

StableUtilitaires⏱ 3 min

Utilisateurs (démo)

Chargement...
Python
bpm.crud(title="Produits", endpoint="/api/products", columns=cols, fields=fields)
PropTypeDéfautRequisDescription
titlestringOuiTitre de la page.
endpointstringOuiURL de l'API (GET liste, POST création, PUT/DELETE par id).
columnsCrudColumn[]OuiColonnes du tableau (key, label, type?, sortable?).
fieldsCrudField[]OuiChamps du formulaire (key, label, type, required?, options?).
domainstringNonDomaine optionnel.
semanticstringNonSémantique optionnelle.
idKeystringidNonChamp utilisé comme identifiant pour GET/PUT/DELETE.

Exemples

cols = [{"key": "name", "label": "Nom", "type": "text"}, {"key": "price", "label": "Prix", "type": "number"}]
fields = [{"key": "name", "label": "Nom", "type": "text", "required": True}, {"key": "price", "label": "Prix", "type": "number"}]
bpm.crud(title="Produits", endpoint="/api/products", columns=cols, fields=fields)
bpm.crud(title="Utilisateurs", endpoint="/api/users", columns=cols, fields=fields, idKey="uuid")