Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

forge-mvc-settings

Paramètres applicatifs opt-in pour Forge : des réglages d'application persistés dans MariaDB, en paire clé/valeur typée, avec une API explicite.

Ce paquet évite de tout mettre dans .env : ce qui change à l'exécution (nom d'établissement, durée d'une session, mode maintenance, options pédagogiques) vit dans une table app_settings, lisible et modifiable par l'application.

Installation

pip install --pre forge-mvc-settings

En développement depuis le dépôt Forge : pip install -e ./packages/forge-mvc-settings.

Mise en place de la table

La table n'est pas créée automatiquement (principe : SQL visible, pas d'écriture cachée). Le paquet fournit une migration :

forge settings:init        # copie la migration dans mvc/migrations/
forge migration:apply      # crée la table app_settings

Utilisation

from forge_mvc_settings import get_setting, set_setting

set_setting("etablissement.nom", "Collège Victor Hugo")
set_setting("qcm.session_duration", 30)        # int
set_setting("maintenance", False)              # bool

nom = get_setting("etablissement.nom")          # "Collège Victor Hugo"
duree = get_setting("qcm.session_duration", 20) # 30 (int)
en_maintenance = get_setting("maintenance")     # False (bool)

L'API expose get_setting, set_setting, get_all_settings, delete_setting, plus SettingsError, TABLE_NAME et SUPPORTED_TYPES.

Périmètre

  • Types supportés : str, int, bool, float (sérialisés en texte, recoercés à la lecture).
  • Le cœur de Forge ignore tout des paramètres ; la dépendance va de l'opt-in vers le cœur, jamais l'inverse.
  • Hors périmètre : cache, secrets chiffrés, paramètres par utilisateur.

Documentation complète : https://forgemvc.com/docs/forge/.

Release files for forge-mvc-settings 1.0.0rc4

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

Source distribution (sdist)

Source distribution for forge-mvc-settings 1.0.0rc4
File Size Uploaded
forge_mvc_settings-1.0.0rc4.tar.gz 12.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for forge-mvc-settings 1.0.0rc4
File Interpreter ABI Platform
forge_mvc_settings-1.0.0rc4-py3-none-any.whl Python 3 none any Details

Total release size: 22.9 kB

Release files / forge_mvc_settings-1.0.0rc4.tar.gz

Download URL forge_mvc_settings-1.0.0rc4.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fc993514c4a41f222ac864069cc91c76ddfa6f06b8ac2e7e0e20a15280433bd7
BLAKE2b-256 checksum
How to use checksums
76d60346dd410b4bdb98bca8d33ada4b1e4becf9f5fdd1d885197e52f8d1421f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / forge_mvc_settings-1.0.0rc4-py3-none-any.whl

Download URL forge_mvc_settings-1.0.0rc4-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb699ebd7c602babdfbb2f9cce6ad7b9358cf4c762ceaaabd520193a673c5602
BLAKE2b-256 checksum
How to use checksums
125e7d181ea302da7f18cc9c29660623316f7eb2e51c2abf15012160d159d2d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13
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