本文整理汇总了Python中models.comment.Comment.getByPin方法的典型用法代码示例。如果您正苦于以下问题:Python Comment.getByPin方法的具体用法?Python Comment.getByPin怎么用?Python Comment.getByPin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.comment.Comment
的用法示例。
在下文中一共展示了Comment.getByPin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getPinDetail
# 需要导入模块: from models.comment import Comment [as 别名]
# 或者: from models.comment.Comment import getByPin [as 别名]
def getPinDetail(self,key):
board = Board()
user = User()
thumb = Thumb()
pic = Pic()
comment = Comment()
marks_dict = []
pin = self.get(key)
_pin = {}
_pin['pin'] = self.get(key)
_pin['user'] = user.getDetail(pin['user'])
_pin['pin']['pic'] = pic.get(pin['key'])['url']
_pin['board'] = board.getDetailWithPinThumb(pin['board'])
_pin['comments'] = comment.getByPin( pin['key'])
return _pin
示例2: formatPins
# 需要导入模块: from models.comment import Comment [as 别名]
# 或者: from models.comment.Comment import getByPin [as 别名]
def formatPins(self,data):
board = Board()
user = User()
thumb = Thumb()
comment = Comment()
marks_dict = []
for pin in data:
_pin = {}
_pin['pin'] = pin
_pin['user'] = user.getDetail(pin['user'])
_pin['thumb'] = thumb.get(pin['key'])
_pin['board'] = board.getDetail(pin['board'])
#print _pin['board']
_pin['comments'] = comment.getByPin( pin['key'])
marks_dict.append(_pin)
return marks_dict