本文整理汇总了Python中notification.models.Notification.envoyer_multiple方法的典型用法代码示例。如果您正苦于以下问题:Python Notification.envoyer_multiple方法的具体用法?Python Notification.envoyer_multiple怎么用?Python Notification.envoyer_multiple使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类notification.models.Notification
的用法示例。
在下文中一共展示了Notification.envoyer_multiple方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: envoyer_commentaire_notification
# 需要导入模块: from notification.models import Notification [as 别名]
# 或者: from notification.models.Notification import envoyer_multiple [as 别名]
def envoyer_commentaire_notification(self, comment_pk, username):
eleve = UserProfile.objects.get(user__username=username)
message = eleve.first_name + " " + eleve.last_name + " a commente un message de " + self.association.nom
commentaire = Comment.objects.get(pk=comment_pk)
notification = Notification(content_object=commentaire, description=message)
notification.save()
notification.envoyer_multiple(self.association.suivi_par.all())
示例2: envoyer_notification
# 需要导入模块: from notification.models import Notification [as 别名]
# 或者: from notification.models.Notification import envoyer_multiple [as 别名]
def envoyer_notification(self):
try:
bde = Association.objects.get(pseudo='bde') #On envoie seulement à ceux qui suivent le BDE
notification = Notification(content_object=self, message='Un nouveau petit cours est disponible')
notification.save()
notification.envoyer_multiple(bde.suivi_par.all())
except Association.DoesNotExist:
pass
示例3: envoyer_notification
# 需要导入模块: from notification.models import Notification [as 别名]
# 或者: from notification.models.Notification import envoyer_multiple [as 别名]
def envoyer_notification(self):
try:
perm = Permission.objects.get(codename='add_sondage') #On envoie seulement à ceux qui peuvent créer des sondages
users = User.objects.filter(Q(is_superuser=True) | Q(groups__permissions=perm) | Q(user_permissions=perm) ).distinct()
notification = Notification(content_object=self, description='Un nouveau sondage a été proposé')
notification.save()
notification.envoyer_multiple(users)
except Permission.DoesNotExist:
pass
示例4: envoyer_message_notification
# 需要导入模块: from notification.models import Notification [as 别名]
# 或者: from notification.models.Notification import envoyer_multiple [as 别名]
def envoyer_message_notification(self):
message = self.association.nom + " a publie un nouveau message"
notification = Notification(content_object=self, message=message)
notification.save()
if self.destinataire is None:
notification.envoyer_multiple(self.association.suivi_par.all())
else:
recipients = self.association.suivi_par.all().filter(
Q(userprofile__in=self.destinataire.membres.all) | Q(userprofile__in=self.association.membres.all)
)
notification.envoyer_multiple(recipients)
示例5: envoyer_commentaire_notification
# 需要导入模块: from notification.models import Notification [as 别名]
# 或者: from notification.models.Notification import envoyer_multiple [as 别名]
def envoyer_commentaire_notification(self, comment_pk, username):
eleve = UserProfile.objects.get(user__username=username)
message = eleve.first_name + " " + eleve.last_name + " a commente un message de " + self.association.nom
commentaire = Comment.objects.get(pk=comment_pk)
notification = Notification(content_object=commentaire, message=message)
notification.save()
if self.destinataire is None:
notification.envoyer_multiple(self.association.suivi_par.all())
else:
recipients = self.association.suivi_par.all().filter(
Q(userprofile__in=self.destinataire.membres.all) | Q(userprofile__in=self.association.membres.all)
)
notification.envoyer_multiple(recipients)
示例6: envoyer_message_notification
# 需要导入模块: from notification.models import Notification [as 别名]
# 或者: from notification.models.Notification import envoyer_multiple [as 别名]
def envoyer_message_notification(self):
message = self.association.nom + " a publie un nouveau message"
notification = Notification(content_object=self, description=message)
notification.save()
notification.envoyer_multiple(self.association.suivi_par.all())
示例7: envoyer_notification
# 需要导入模块: from notification.models import Notification [as 别名]
# 或者: from notification.models.Notification import envoyer_multiple [as 别名]
def envoyer_notification(self):
notification = Notification(content_object=self, message = self.association.nom + ' a publie une nouvelle video')
notification.save()
notification.envoyer_multiple(self.association.suivi_par.all())
示例8: envoyer_notification
# 需要导入模块: from notification.models import Notification [as 别名]
# 或者: from notification.models.Notification import envoyer_multiple [as 别名]
def envoyer_notification(self):
notification = Notification(content_object=self, description=self.association.nom+' a publie une nouvelle affiche')
notification.save()
notification.envoyer_multiple(self.association.suivi_par.all())