def assign(post_data): if post_data.get('type', '') == 'preview': return preview_action(post_data) elif post_data.get('type', '') == 'submit': return submit_action(post_data) else: post_data['pid'] = '98' render_dict = commonDistribution.assign(post_data) project_list = [] info_dict = {} query_set = [] if post_data.get('item_id', '')=='110': ##仅针对添加内容页面 project_list = model_to_object(get_project_list()) if 'show_pid' in post_data: query_set = get_project_info(post_data['show_pid']) if 'show_itemid' in post_data: query_set = get_item_text(post_data['show_itemid']) object = model_to_object(query_set) if object: info_dict = object[0] info_dict['project_list'] = project_list render_dict['item_content'] = template_to_html(render_dict['item_content'], info_dict) return render_dict
def assign(post_data): return commonDistribution.assign(post_data)