本文整理匯總了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())