Forge Notifications — notifications in-app opt-in : table notifications, API notify/get_notifications/mark_read, SQL visible.
Project description
forge-mvc-notifications
Notifications in-app opt-in pour Forge : créer des notifications destinées aux
utilisateurs (élève inscrit, note publiée, devoir à rendre) dans une table
notifications, les lire, les marquer comme lues.
Périmètre V1 : notifications in-app (des lignes en base, affichées dans l'IHM).
La livraison hors application (email, push) reste à la charge de l'application,
par exemple en combinant ce paquet avec forge-mvc-jobs et forge-mvc-mail.
Installation
pip install --pre forge-mvc-notifications
En développement : pip install -e ./packages/forge-mvc-notifications.
Mise en place de la table
forge notifications:init # copie la migration dans mvc/migrations/
forge migration:apply # crée la table notifications
Utilisation
from forge_mvc_notifications import notify, get_notifications, unread_count, mark_read
notify("eleve.42", "Votre note est publiée", type="info", data={"cours": "maths"})
print(unread_count("eleve.42")) # 1
for n in get_notifications("eleve.42", unread_only=True):
print(n.message, n.created_at)
mark_read(1)
L'API expose notify, get_notifications, unread_count, mark_read,
mark_all_read, plus Notification, NotificationError, TABLE_NAME,
MAX_LIMIT et CREATE_TABLE_SQL.
Périmètre
- Stockage in-app uniquement (lignes en base).
- Hors périmètre : livraison email/push (à combiner avec
forge-mvc-jobs+forge-mvc-mail), préférences de notification, temps réel.
Documentation complète : https://forgemvc.com/docs/forge/.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file forge_mvc_notifications-1.0.0rc2.tar.gz.
File metadata
- Download URL: forge_mvc_notifications-1.0.0rc2.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8f9f31acd16394fafa8b58e522c078957fefe9c6db16b584d1204ec2f7761df
|
|
| MD5 |
16de98de4fafe8a50befe15f9f0835f6
|
|
| BLAKE2b-256 |
fd0a415ffa7a5a8632c0f22eb176798ecd92f341f1dd68f301a6dfe81722d492
|
File details
Details for the file forge_mvc_notifications-1.0.0rc2-py3-none-any.whl.
File metadata
- Download URL: forge_mvc_notifications-1.0.0rc2-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebac0e2022bd6a40a1db3ad81476f629b16f0cc5542afc89f2f463018735fb4f
|
|
| MD5 |
ec7bfef0c3d41c4c882e44f15afa8f41
|
|
| BLAKE2b-256 |
89f312d74b09bc38ca19bec4f649549eeab683df015d66ba109a9aca9e2a19fd
|