def create_label(): try: label = com_post(db, Label) except Exception as e: current_app.logger.error("[label][post] fail expection: {}".format(e)) return InvalidMessage(str(e), 500) data = model_helper.obj_to_dict(label) return return_data(data, 201)
def create_scene(): try: scene = com_post(db, Scene) except Exception as e: current_app.logger.error("[scene][post] fail expection: {}".format(e)) return InvalidMessage(str(e), 500) data = model_helper.obj_to_dict(scene) return return_data(data, 201)
def create_group(): try: group = com_post(db, Group) except Exception as e: current_app.logger.error("[group][post] fail expection: {}".format(e)) raise InvalidMessage(str(e), 500) data = user_helper.make_group_reponse_body(group) return return_data(data, 201)
def create_paper_question(): try: paper_question = com_post(db, PaperQuestion) except Exception as e: current_app.logger.error( "[paper_question][post] fail expection: {}".format(e)) return InvalidMessage(str(e), 500) data = model_helper.obj_to_dict(paper_question) return return_data(data, 201)
def create_user_head(): try: user_head = com_post(db, UserHead) except Exception as e: current_app.logger.error( "[user_head][post] fail expection: {}".format(e)) return InvalidMessage(str(e), 500) data = model_helper.obj_to_dict(user_head) return return_data(data, 201)