本文整理汇总了Python中pyasm.biz.Schema.get_by_sobject方法的典型用法代码示例。如果您正苦于以下问题:Python Schema.get_by_sobject方法的具体用法?Python Schema.get_by_sobject怎么用?Python Schema.get_by_sobject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.biz.Schema
的用法示例。
在下文中一共展示了Schema.get_by_sobject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_display
# 需要导入模块: from pyasm.biz import Schema [as 别名]
# 或者: from pyasm.biz.Schema import get_by_sobject [as 别名]
#.........这里部分代码省略.........
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())
# TEST getting schema
search_type = sobject.get_base_search_type()
schema = Schema.get_by_sobject(sobject)
# add a second table
table = Table()
table.set_max_width()
# show the snapshots for this sobject
search_type = "sthpw/snapshot"
search = Search(search_type)
search.add_sobject_filter(sobject)
search.set_limit(50)
sobjects = search.get_sobjects()
table.add_row()
nav_td = table.add_cell()
nav_td.add_style("width: 100px")
nav_td.add_style("vertical-align: top")
#section_wdg = my.get_section_wdg(sobject)
#nav_td.add( section_wdg )
#from tactic.ui.panel import ManageViewPanelWdg
#defined = ManageViewPanelWdg()
from tactic.ui.panel import ManageViewWdg
defined = ManageViewWdg()
nav_td.add(defined)
#content_wdg = TableLayoutWdg(search_type=search_type, view='table')
#content_wdg.set_sobjects(sobjects)
#content_td = table.add_cell()
#content_td.set_id("sobject_relation")
#content_td.add_style("display: table-cell")
#content_td.add_style("vertical-align: top")
#content_td.add(content_wdg)
div.add(table)
return div
示例2: get_display
# 需要导入模块: from pyasm.biz import Schema [as 别名]
# 或者: from pyasm.biz.Schema import get_by_sobject [as 别名]
#.........这里部分代码省略.........
# tasks
td = table.add_cell()
td.add_style("vertical-align: top")
td.add_style("padding-left: 5px")
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("Tasks")
td.add(title)
task_wdg = SObjectTaskTableElement()
task_wdg.set_sobject(sobject)
td.add(task_wdg)
td.add_style('cell-padding','10')
# discussion
td = table.add_cell()
#td.add_style("min-width: 300px")
#td.add_style("width: 600px")
td.add_style("vertical-align: top")
td.add_style("padding-left: 5px")
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("Notes")
td.add(title)
discussion_wdg = DiscussionWdg()
discussion_wdg.preprocess()
discussion_wdg.set_sobject(sobject)
td.add(discussion_wdg)
note_panel = discussion_wdg.get_note_menu()
td.add(note_panel)
div.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())
# TEST getting schema
search_type = sobject.get_base_search_type()
schema = Schema.get_by_sobject(sobject)
child_types = schema.get_child_types(search_type)
# add a second table
table = Table()
table.set_max_width()
# show the snapshots for this sobject
search_type = "sthpw/snapshot"
search = Search(search_type)
search.add_sobject_filter(sobject)
search.set_limit(25)
sobjects = search.get_sobjects()
table.add_row()
nav_td = table.add_cell()
nav_td.add_style("width: 100px")
nav_td.add_style("vertical-align: top")
section_wdg = my.get_section_wdg(sobject)
nav_td.add( section_wdg )
parent_key = SearchKey.get_by_sobject(sobject)
content_wdg = ViewPanelWdg(search_type=search_type, element_name='Snapshots', \
title='Snapshots', view='table', parent_key=parent_key, do_search=True)
#content_wdg.set_sobjects(sobjects)
content_td = table.add_cell()
content_td.set_id("sobject_relation")
content_td.add_style("display: table-cell")
content_td.add_style("vertical-align: top")
content_td.add_style("padding-left: 10px")
content_td.add(content_wdg)
div.add(table)
return div