def create_pic(bus_type, bus_id, img_type, url, override=False): if override: PicMgr.clear_pic_list(bus_type, bus_id, img_type) sequence = 1 else: sequence = PicMgr.get_last_sequence_by_type(bus_type, bus_id, img_type) + 1 return PicMgr.create(bus_type=bus_type, bus_id=bus_id, img_type=img_type, url=url, sequence=sequence)
def create_pic(bus_type, bus_id, img_type, url, override): if override: PicMgr.clear_pic_list(bus_type, bus_id, img_type) sequence = 1 else: sequence = PicMgr.get_last_sequence_by_type(bus_type, bus_id, img_type) + 1 if bus_type == 'post': ProjRecruitPostMgr.modified(bus_id) return PicMgr.create(bus_type=bus_type, bus_id=bus_id, img_type=img_type, url=url, sequence=sequence)