SciPost Code Repository
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SciPost
Manage
Activity
Members
Labels
Plan
Issues
118
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SciPost
SciPost
Commits
333ce2bd
Commit
333ce2bd
authored
7 years ago
by
Jorran de Wit
Browse files
Options
Downloads
Patches
Plain Diff
Easy sending of notifications using signals
parent
89722967
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
notifications/__init__.py
+1
-0
1 addition, 0 deletions
notifications/__init__.py
notifications/apps.py
+5
-0
5 additions, 0 deletions
notifications/apps.py
notifications/signals.py
+13
-0
13 additions, 0 deletions
notifications/signals.py
with
19 additions
and
0 deletions
notifications/__init__.py
+
1
−
0
View file @
333ce2bd
default_app_config
=
'
notifications.apps.Config
'
This diff is collapsed.
Click to expand it.
notifications/apps.py
+
5
−
0
View file @
333ce2bd
...
@@ -3,3 +3,8 @@ from django.apps import AppConfig
...
@@ -3,3 +3,8 @@ from django.apps import AppConfig
class
NotificationsConfig
(
AppConfig
):
class
NotificationsConfig
(
AppConfig
):
name
=
'
notifications
'
name
=
'
notifications
'
def
ready
(
self
):
super
().
ready
()
import
notifications.signals
notifications
.
notify
=
notifications
.
signals
.
notify
This diff is collapsed.
Click to expand it.
notifications/signals.py
0 → 100644
+
13
−
0
View file @
333ce2bd
from
django.dispatch
import
Signal
notify
=
Signal
(
providing_args
=
[
'
recipient
'
,
'
actor
'
,
'
verb
'
,
'
action_object
'
,
'
target
'
,
'
description
'
,
'
timestamp
'
,
'
level
'
])
# Basic working method to send a notification to a user using signals:
# ---
# from notifications.signals import notify
# notify.send(user, recipient=user, verb='you reached level 10')
# ---
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment