本文整理汇总了Python中data.storage.Storage.getMessagesFromDiscussionId方法的典型用法代码示例。如果您正苦于以下问题:Python Storage.getMessagesFromDiscussionId方法的具体用法?Python Storage.getMessagesFromDiscussionId怎么用?Python Storage.getMessagesFromDiscussionId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类data.storage.Storage
的用法示例。
在下文中一共展示了Storage.getMessagesFromDiscussionId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Room
# 需要导入模块: from data.storage import Storage [as 别名]
# 或者: from data.storage.Storage import getMessagesFromDiscussionId [as 别名]
#.........这里部分代码省略.........
#
# announcement add data
#
def announcementadd(self,courseid,anntitle,anndesc,annpostdate,annstatus):
return self.__store.announcementinsert(courseid,anntitle,anndesc,annpostdate,annstatus)
# example: add discussion
#
def addDiscussion(self,course_id,title,createdby,createdAt,updatedAt):
return self.__store.addDiscussion(course_id,title,createdby,createdAt,updatedAt)
def getDiscussionFromId(self,id):
return self.__store.getDiscussionFromId(id)
def getDiscussionFromCourseId(self,course_id):
return self.__store.getDiscussionFromCourseId(course_id)
# example: add message
def addMessage(self,title,content,discussion_id,createdby,createdAt,updatedAt):
return self.__store.addMessage(title,content,discussion_id,createdby,createdAt,updatedAt)
# getMessagesFromDiscussionId
def getMessagesFromDiscussionId(self,discussion_id):
return self.__store.getMessagesFromDiscussionId(discussion_id)
# TODO success|failure
#
# dump the configuration in the requested format. Note placing format logic
# in the functional code is not really a good idea. However, it is here to
# provide an example.
#
#
def dump_conf(self, format):
if format == Room.json:
return self.__conf_as_json()
elif format == Room.html:
return self.__conf_as_html()
elif format == Room.xml:
return self.__conf_as_xml()
elif format == Room.text:
return self.__conf_as_text()
else:
return self.__conf_as_text()
#
# output as xml is supported through other packages. If
# you want to add xml support look at gnosis or lxml.
#
def __conf_as_json(self):
return "xml is hard"
#
#