本文整理汇总了Python中pyasm.biz.Project.get_full_search_type方法的典型用法代码示例。如果您正苦于以下问题:Python Project.get_full_search_type方法的具体用法?Python Project.get_full_search_type怎么用?Python Project.get_full_search_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.biz.Project
的用法示例。
在下文中一共展示了Project.get_full_search_type方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_display
# 需要导入模块: from pyasm.biz import Project [as 别名]
# 或者: from pyasm.biz.Project import get_full_search_type [as 别名]
def get_display(my):
top = my.top
#top.add_color("background", "background" )
top.add_gradient("background", "background", 0, -10 )
search_type = my.kwargs.get("search_type")
assert(search_type)
search_type_obj = SearchType.get(search_type)
title = my.kwargs.get("title")
if not title:
title = search_type_obj.get_title()
if title:
date = "@FORMAT(@STRING($TODAY),'Dec 31, 1999')"
date = Search.eval(date, single=True)
title_wdg = DivWdg()
top.add(title_wdg)
title_wdg.add(title)
title_wdg.add(" [%s]" % date)
title_wdg.add_style("font-size: 14")
title_wdg.add_color("background", "background3")
title_wdg.add_color("color", "color3")
title_wdg.add_style("padding: 10px")
title_wdg.add_style("font-weight: bold")
title_wdg.add_style("text-align: center")
search = Search("sthpw/task")
full_search_type = Project.get_full_search_type(search_type)
search.add_filter("search_type", full_search_type)
tasks = search.get_sobjects()
# organize by search_key
tasks_dict = {}
for task in tasks:
parent_search_type = task.get_value("search_type")
parent_search_id = task.get_value("search_id")
key = "%s|%s" % (parent_search_type, parent_search_id)
task_list = tasks_dict.get(key)
if task_list == None:
task_list = []
tasks_dict[key] = task_list
task_list.append(task)
# go through each sobject and find out where it is "at"
search = Search(search_type)
sobjects = search.get_sobjects()
sobject_statuses = {}
for sobject in sobjects:
# get all the tasks for this sobject
sobject_search_type = sobject.get_search_type()
sobject_search_id = sobject.get_id()
key = "%s|%s" % (sobject_search_type, sobject_search_id)
tasks = tasks_dict.get(key)
if not tasks:
tasks = []
# figure out where in the pipeline this sobject is based
# on the statuses
process_statuses = {}
for task in tasks:
actual_end_date = task.get_value("actual_end_date")
if actual_end_date:
is_complete = True
else:
is_complete = False
process = task.get_value("process")
process_statuses[process] = is_complete
pipeline_code = sobject.get_value("pipeline_code")
pipeline = Pipeline.get_by_code(pipeline_code)
if not pipeline:
process_names = []
else:
process_names = pipeline.get_process_names()
sobject_status = None
none_complete = True
for process_name in process_names:
is_complete = process_statuses.get(process_name)
if is_complete == None:
continue
if is_complete == False:
sobject_status = process_name
break
none_complete = False
#.........这里部分代码省略.........