def format_element(bfo, nbReviews='all', nbComments='all', show_reviews='true'): """ Prints comments posted for the record. @param nbReviews: The max number of reviews to print @param nbComments: The max number of comments to print @param show_reviews: Shows or hides the complete review block """ nb_reviews = nbReviews if nb_reviews.isdigit(): nb_reviews = int(nb_reviews) nb_comments = nbComments if nb_comments.isdigit(): nb_comments = int(nb_comments) if show_reviews in ('true', 'True'): show_reviews = True else: show_reviews = False (comments, reviews) = get_first_comments_or_remarks(recID=bfo.recID, ln=bfo.lang, nb_comments=nb_comments, nb_reviews=nb_reviews, voted=-1, reported=-1, user_info=bfo.user_info, show_reviews=show_reviews) return comments + reviews
def format_element(bfo, nbReviews='all', nbComments='all'): """ Prints comments posted for the record. @param nbReviews: The max number of reviews to print @param nbComments: The max number of comments to print """ nb_reviews = nbReviews if nb_reviews.isdigit(): nb_reviews = int(nb_reviews) nb_comments = nbComments if nb_comments.isdigit(): nb_comments = int(nb_comments) (comments, reviews) = get_first_comments_or_remarks(recID=bfo.recID, ln=bfo.lang, nb_comments=nb_comments, nb_reviews=nb_reviews, voted=-1, reported=-1, user_info=bfo.user_info) return comments + reviews