【问题标题】:Sending notifications to your Friends in Pinax, Django在 Django Pinax 中向您的朋友发送通知
【发布时间】:2010-12-22 03:31:53
【问题描述】:

目前,我正在向数据库中的所有用户发送通知。如何获取我所有朋友的列表,以便将通知发送给我的所有朋友?

if new and notification:
    notification.send(User.objects.all().exclude(id=self.owner.id),
                "listing_new",
                {'listing':self, },
            )

【问题讨论】:

    标签: notifications pinax


    【解决方案1】:

    你可以试试:

    from friends.models import Friendship
    if new and notification:
        notification.send(Friendship.objects.friends_for_user(self.owner.id), "listing_new", {'listing':self, }, )
    

    【讨论】:

      猜你喜欢
      • 2011-08-05
      • 1970-01-01
      • 1970-01-01
      • 2018-07-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-26
      • 1970-01-01
      相关资源
      最近更新 更多