def add_comments(new_nr, comments): # TODO: link to examiner IDs somehow - examiner_IDIR if comments: for c in comments: comm = Comment() comm.comment = c['examiner_comment'] comm.timestamp = c['event_timestamp'] new_nr.comments.append(comm)
def add_comments(nr, comments): # TODO: link to examiner IDs somehow - examiner_IDIR # TODO: append new comments, rather than flushing out all the old ones first for com in nr.comments.all(): nr.comments.remove(com) if comments: for c in comments: comm = Comment() comm.comment = c['examiner_comment'] comm.timestamp = c['event_timestamp'] nr.comments.append(comm)