當前位置: 首頁>>代碼示例>>Python>>正文


Python Notification.envoyer_multiple方法代碼示例

本文整理匯總了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())
開發者ID:wumzi,項目名稱:portail,代碼行數:9,代碼來源:models.py

示例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
開發者ID:gcaner,項目名稱:portail,代碼行數:10,代碼來源:models.py

示例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
開發者ID:ensmp,項目名稱:portail,代碼行數:11,代碼來源:models.py

示例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)
開發者ID:csmfindling,項目名稱:portail,代碼行數:13,代碼來源:models.py

示例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)
開發者ID:csmfindling,項目名稱:portail,代碼行數:15,代碼來源:models.py

示例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())
開發者ID:wumzi,項目名稱:portail,代碼行數:7,代碼來源:models.py

示例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())
開發者ID:csmfindling,項目名稱:portail,代碼行數:6,代碼來源:models.py

示例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())
開發者ID:wumzi,項目名稱:portail,代碼行數:6,代碼來源:models.py


注:本文中的notification.models.Notification.envoyer_multiple方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。