本文整理汇总了Python中models.Message.list_for_user方法的典型用法代码示例。如果您正苦于以下问题:Python Message.list_for_user方法的具体用法?Python Message.list_for_user怎么用?Python Message.list_for_user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Message
的用法示例。
在下文中一共展示了Message.list_for_user方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from models import Message [as 别名]
# 或者: from models.Message import list_for_user [as 别名]
def get(self, cursor_url):
user = users.get_current_user()
messages, next_cursor, more = Message.list_for_user(user, cursor_url, limit=20)
if (more and next_cursor):
next_page_url = "/inbox/%s" % next_cursor.urlsafe()
else:
next_page_url = None
self.render("inbox.html", {'messages': messages,
'next_page_url': next_page_url})
示例2: testSendGroupMessage
# 需要导入模块: from models import Message [as 别名]
# 或者: from models.Message import list_for_user [as 别名]
def testSendGroupMessage(self):
# user logs in for the first time
UserProfile.for_user(self.user2)
# send group message and check if it's recorded
self._sendGroupMessage()
self.assertEqual(1, GroupMessage.query().count())
# no 1 to 1 messages are stored until the user checks inbox
self.assertEqual(0, Message.query().count())
# after checking messages a copy of the group message is stored in inbox
(messages, _, _) = Message.list_for_user(self.user2)
self.assertEqual(1, len(messages))
示例3: testInbox
# 需要导入模块: from models import Message [as 别名]
# 或者: from models.Message import list_for_user [as 别名]
def testInbox(self):
self._sendMessage()
self._sendMessage()
(messages, _, _) = Message.list_for_user(self.user2)
self.assertEqual(2, len(messages))