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.0rc5

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.0rc5
File Size Uploaded
forge_mvc_settings-1.0.0rc5.tar.gz 12.7 kB Details

Built distribution (wheel)

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

Total release size: 22.8 kB

Release files / forge_mvc_settings-1.0.0rc5.tar.gz

Download URL forge_mvc_settings-1.0.0rc5.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
37c83482d6373a3164cc22d30f18243f88075d9bf8b84ac0380f2934a9d40a13
BLAKE2b-256 checksum
How to use checksums
f4bd42e268b937ee0604892687f26eae661985dfe5d2c0fc6b807a6c40ae00d2
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.0rc5-py3-none-any.whl

Download URL forge_mvc_settings-1.0.0rc5-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cfe6793f6d01738199b2c9c29c4a207ec89fa23907264094c4d0c7a282aa72f3
BLAKE2b-256 checksum
How to use checksums
f23ce81925449e3b247b1568c2f845e51f55cc71f037f73aa1bd64d1e50de341
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