def from_queryset_with_viewer_stickers(cls, viewer, comments): bottoms, tops = CachedCall.many_multicall([cmt.details for cmt in comments], [cmt.thread.op.details for cmt in comments]) tiles = [] for bottom, top in zip(bottoms, tops): tile = cls(bottom, top) tile.viewer_sticker = Comment.get_sticker_from_user_for_comment_id(bottom.id, viewer) tiles.append(tile) return tiles
def from_shared_op_details_with_viewer_stickers(cls, viewer, top_details, reply_details): """ `top_details` is a single CommentDetails instance of the monster top. `reply_details` is a list of CommentDetails instances, of the monster replies/bottoms. """ tiles = [] for bottom in reply_details: tile = cls(bottom, top_details) tile.viewer_sticker = Comment.get_sticker_from_user_for_comment_id(bottom.id, viewer) tiles.append(tile) return tiles
def from_queryset_with_viewer_stickers(cls, viewer, comments): bottoms, tops = CachedCall.many_multicall( [cmt.details for cmt in comments], [cmt.thread.op.details for cmt in comments]) tiles = [] for bottom, top in zip(bottoms, tops): tile = cls(bottom, top) tile.viewer_sticker = Comment.get_sticker_from_user_for_comment_id( bottom.id, viewer) tiles.append(tile) return tiles
def from_shared_op_details_with_viewer_stickers(cls, viewer, top_details, reply_details): """ `top_details` is a single CommentDetails instance of the monster top. `reply_details` is a list of CommentDetails instances, of the monster replies/bottoms. """ tiles = [] for bottom in reply_details: tile = cls(bottom, top_details) tile.viewer_sticker = Comment.get_sticker_from_user_for_comment_id( bottom.id, viewer) tiles.append(tile) return tiles