本文整理汇总了Python中messages.models.Message.user方法的典型用法代码示例。如果您正苦于以下问题:Python Message.user方法的具体用法?Python Message.user怎么用?Python Message.user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类messages.models.Message
的用法示例。
在下文中一共展示了Message.user方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: send_complete_message
# 需要导入模块: from messages.models import Message [as 别名]
# 或者: from messages.models.Message import user [as 别名]
def send_complete_message(self):
msg = Message()
msg.user = self.user
msg.subject = u'Your request was completed'
msg.object = self
msg.save()
return msg
示例2: invite_send_message
# 需要导入模块: from messages.models import Message [as 别名]
# 或者: from messages.models.Message import user [as 别名]
def invite_send_message(sender, instance, created, **kwargs):
if created:
msg = Message()
msg.subject = ugettext(u'Invitation to join a team')
msg.user = instance.user
msg.object = instance
msg.author = instance.author
msg.save()
示例3: invite_send_message
# 需要导入模块: from messages.models import Message [as 别名]
# 或者: from messages.models.Message import user [as 别名]
def invite_send_message(sender, instance, created, **kwargs):
if created:
msg = Message()
msg.user = instance.user
msg.object = instance
msg.save()