def comment_dtos(): comment_dtos = [ CommentDto(comment_id=1, user_id=2, post_id=1, comment_content="nice post", pub_date_time=datetime.datetime(2019, 4, 22, 0, 0), parent_comment=None), CommentDto(comment_id=2, user_id=2, post_id=None, comment_content="nice post", pub_date_time=datetime.datetime(2019, 4, 22, 0, 0), parent_comment=1) ] return comment_dtos
def get_comment_dtos(): comment_dtos = [ CommentDto(comment_id=1, user_id=1, post_id=1, comment_content='nice post', pub_date_time='04-22-2019,00:00:1555871400.000000', parent_comment=None), CommentDto(comment_id=2, user_id=1, post_id=1, comment_content='great', pub_date_time='04-22-2019,00:00:1555871400.000000', parent_comment=None) ] return comment_dtos
def _convert_reply_object_to_dto(reply): reply_dto = CommentDto( comment_id=reply.id, parent_comment=reply.parent_comment.id, pub_date_time=reply.pub_date_time.replace(tzinfo=None), post_id=reply.post, user_id=reply.user.id, comment_content=reply.comment_text) return reply_dto
def _convert_comment_obj_to_dto(comment): comment_dto = CommentDto( comment_id=comment.id, user_id=comment.user.id, post_id=comment.post.id, comment_content=comment.comment_text, pub_date_time=comment.pub_date_time.replace(tzinfo=None), parent_comment=comment.parent_comment) return comment_dto
def replies_dtos(): replies_dtos = [ CommentDto(comment_id=3, user_id=1, post_id=None, parent_comment=2, comment_content='nice', pub_date_time=datetime.datetime(2019, 4, 22, 0, 0)) ] return replies_dtos
def comment_dtos(): comment_dtos = [ CommentDto(comment_id=1, user_id=1, post_id=1, parent_comment=None, comment_content='nice post', pub_date_time=datetime.datetime(2019, 4, 22, 0, 0)), CommentDto(comment_id=2, user_id=2, post_id=1, parent_comment=None, comment_content='great', pub_date_time=datetime.datetime(2019, 4, 22, 0, 0)), CommentDto(comment_id=3, user_id=1, post_id=None, parent_comment=2, comment_content='nice', pub_date_time=datetime.datetime(2019, 4, 22, 0, 0)) ] return comment_dtos