Created
February 7, 2018 19:51
-
-
Save yxy/936afc40b9418ae96c86b0e757338652 to your computer and use it in GitHub Desktop.
django 事件信号
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.dispatch import Signal | |
# 注册 | |
user_created = Signal(providing_args=['user', 'app_id']) | |
# 更新 | |
user_updated = Signal(providing_args=['user', 'app_id']) | |
# 登录 | |
user_logged = Signal(providing_args=['user', 'ip', 'app_id']) | |
# 登出 | |
user_logout = Signal(providing_args=['user', 'ip', 'app_id']) | |
# 封禁 | |
user_banned = Signal(providing_args=['user', 'reason']) | |
# 发送短信 | |
user_sent_code = Signal(providing_args=['user', 'code']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment