当前位置: 首页>>代码示例>>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;未经允许,请勿转载。