本文整理汇总了Python中pyasm.web.Table.set_sobjects方法的典型用法代码示例。如果您正苦于以下问题:Python Table.set_sobjects方法的具体用法?Python Table.set_sobjects怎么用?Python Table.set_sobjects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.web.Table
的用法示例。
在下文中一共展示了Table.set_sobjects方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_display
# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import set_sobjects [as 别名]
def get_display(self):
top = self.top
search = Search("sthpw/snapshot")
search.add_order_by("timestamp desc")
search.add_filter("code", "61239PG")
snapshot = search.get_sobject()
xml = snapshot.get_value("snapshot")
files = snapshot.get_all_file_objects()
ref_snapshots = snapshot.get_all_ref_snapshots()
table = Table()
top.add(table)
table.add_row()
td = table.add_cell()
canvas = self.get_canvas()
td.add(canvas)
table.add_row()
td = table.add_cell()
from tactic.ui.panel import TableLayoutWdg
file_table = TableLayoutWdg(search_type="sthpw/file", view='table')
td.add(file_table)
table.set_sobjects(files)
xml = []
xml.append("<dependency>")
for file in files:
file_name = file.get_value("file_name")
xml.append('''<node name="%s"/>''' % file_name)
xml.append('''<node name="%s"/>''' % snapshot.get_code())
for ref_snapshot in ref_snapshots:
code = ref_snapshot.get_code()
xml.append('''<node name="%s"/>''' % code)
xml.append('''<connect from="%s" to="%s"/>''' % (code, snapshot.get_code() ))
xml.append("</dependency>")
xml = "\n".join(xml)
div = DivWdg()
top.add(div)
div.add_behavior( {
'type': 'load',
'xml': xml,
'cbjs_action': '''
var group = 'dependency';
var color = '#336655';
spt.pipeline.import_xml(bvr.xml, group, color);
'''
} )
return top
示例2: get_display
# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import set_sobjects [as 别名]
def get_display(my):
div = DivWdg()
search_type = "prod/asset"
search_type_obj = SearchType.get(search_type)
title = search_type_obj.get_title()
title_wdg = DivWdg()
title_wdg.add_style("font-size: 1.8em")
title_wdg.add("%s" % (title) )
div.add(title_wdg)
div.add(HtmlElement.hr())
table = Table()
div.add(table)
table.set_max_width()
table.add_row()
from pyasm.widget import ThumbWdg, DiscussionWdg, SObjectTaskTableElement
td = table.add_cell()
td.add_style("width: 250px")
td.add_style("vertical-align: top")
td.add_style("border-right: solid 1px")
title = DivWdg()
title.add_class("maq_search_bar")
x = DivWdg("[?] [x]")
x.add_style("float: right")
title.add(x)
title.add("Info")
td.add(title)
thumb = ThumbWdg()
thumb.set_sobject(sobject)
td.add(thumb)
from pyasm.prod.web import AssetInfoWdg
info = AssetInfoWdg()
info.thumb = thumb
info.set_sobject(sobject)
td.add(info)
td = table.add_cell()
td.add_style("vertical-align: top")
td.add_style("padding-left: 5px")
td.add_style("border-right: solid 1px")
# notes
title = DivWdg()
title.add_class("maq_search_bar")
x = DivWdg("[x]")
x.add_style("float: right")
title.add(x)
title.add("Notes")
td.add(title)
discussion_wdg = DiscussionWdg()
discussion_wdg.preprocess()
discussion_wdg.set_sobject(sobject)
td.add(discussion_wdg)
td = table.add_cell()
td.add_style("vertical-align: top")
td.add_style("padding-left: 5px")
td.add_style("border-right: solid 1px")
# tasks
title = DivWdg()
title.add_class("maq_search_bar")
x = DivWdg("[x]")
x.add_style("float: right")
title.add(x)
title.add("Custom Properties")
td.add(title)
search = Search("prod/custom_property")
search.add_filter("search_type", "sample3d/book")
sobjects = search.get_sobjects()
table = TableLayoutWdg(search_type="prod/custom_property", view='table')
table.set_sobjects(sobjects)
td.add(table)
div.add(HtmlElement.hr())
div.add(HtmlElement.br(clear="all"))
title_wdg = DivWdg()
title_wdg.add_class("maq_search_bar")
x = DivWdg("[x]")
x.add_style("float: right")
title_wdg.add(x)
#title_wdg.add_style("font-size: 1.5em")
title_wdg.add("Detail" )
div.add(title_wdg)
div.add(HtmlElement.br())
#.........这里部分代码省略.........