本文整理汇总了Python中pyasm.widget.TableWdg类的典型用法代码示例。如果您正苦于以下问题:Python TableWdg类的具体用法?Python TableWdg怎么用?Python TableWdg使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TableWdg类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_camera_wdg
def get_camera_wdg(self):
widget = Widget()
div = DivWdg(css="filter_box")
sequence_filter = SequenceFilterWdg()
epi_code, sequence_code = sequence_filter.get_value()
div.add(sequence_filter)
search = Search("prod/camera")
columns = ['shot_code', 'description']
search_filter = SearchFilterWdg("camera_search", columns=columns,\
has_persistence=False)
search_filter.alter_search(search)
div.add(search_filter)
widget.add(div)
if sequence_code:
search.add_where("shot_code in (select code from shot where sequence_code = '%s')" % sequence_code)
table = TableWdg("prod/camera")
table.set_search(search)
widget.add(table)
return widget
示例2: _get_sobject_history_wdg
def _get_sobject_history_wdg(my):
''' this method is called thru ajax '''
args = WebContainer.get_web().get_form_args()
# get the args in the URL
search_type = args['search_type']
search_id = args['search_id']
#sobject = Search.get_by_id(search_type, search_id)
div = Widget()
search = Search("sthpw/sobject_log")
search.add_filter("search_type", search_type)
search.add_filter("search_id", search_id)
sobjects = search.get_sobjects()
search = Search("sthpw/transaction_log")
search.add_filters("id", [x.get_value("transaction_log_id") for x in sobjects] )
sobjects = search.get_sobjects()
table = TableWdg("sthpw/transaction_log", "table", css='table')
table.set_show_property(False)
table.set_sobjects(sobjects)
div.add(table)
div.add(HtmlElement.br(2))
return div
div.add(assigned_shot_wdg)
div.add(HtmlElement.br(2))
return div
示例3: get_left_wdg
def get_left_wdg(my, view="layout_left"):
search_type = my.get_left_search_type()
search = Search(search_type)
# filter by project
#project_code = Project.get_project_code()
#search.add_filter("project_code", project_code )
# use a holding place for these "special"
#parent_search_type = my.get_right_search_type()
#search.add_filter("search_type", "%s?project=%s" % \
# (parent_search_type, project_code) )
search.add_filter("s_status", "__TEMPLATE__")
left_div = DivWdg()
left_div.add_style("margin: 10px")
left_div.add(HtmlElement.h3("Template Task") )
asset_filter = my.get_left_filter(search)
filter_box = DivWdg(asset_filter, css='filter_box')
left_div.add(filter_box)
asset_filter.alter_search(search)
assets_table = TableWdg(search_type, view)
assets_table.set_sobjects(search.get_sobjects(), search)
left_div.add(assets_table)
return left_div
示例4: get_art_reference
def get_art_reference(self):
widget = Widget()
help = HelpItemWdg('References', 'References tab lets the user organize art references. Each reference can be [related] to one or more assets defined in TACTIC. It can be set up when you [Edit] the reference.')
self.add(help)
div = DivWdg(css="filter_box")
widget.add(div)
columns = ['description','keywords']
search_filter = SearchFilterWdg("art_ref_search", columns=columns,\
has_persistence=False)
div.add(search_filter)
select = FilterSelectWdg("art_ref_category", label='Category: ', css='snall')
select.set_option("setting", "art_reference_category")
select.add_empty_option('-- Any --')
div.add( select )
table = TableWdg("prod/art_reference")
search = Search("prod/art_reference")
search_filter.alter_search(search)
value = select.get_value()
if value != "":
search.add_filter("category", value)
table.set_search(search)
widget.add(table)
return widget
示例5: get_milestone_wdg
def get_milestone_wdg(self):
widget = Widget()
search = Search("sthpw/milestone")
table = TableWdg("sthpw/milestone")
table.set_search(search)
widget.add(table)
return widget
示例6: get_project_settings_wdg
def get_project_settings_wdg(my):
widget = Widget()
search = Search("prod/prod_setting")
table = TableWdg("prod/prod_setting")
table.set_search(search)
widget.add(table)
return widget
示例7: get_naming_wdg
def get_naming_wdg(my):
widget = Widget()
table = TableWdg("prod/naming")
search = Search("prod/naming")
sobjects = search.get_sobjects()
table.set_sobjects(sobjects)
widget.add(table)
return widget
示例8: get_display
def get_display(self):
web = WebContainer.get_web()
widget = Widget()
search_type = web.get_form_value("parent_search_type")
search_id = web.get_form_value("parent_search_id")
if not search_type:
widget.add("RenderSubmitInfo: parent type not found")
return widget
hidden = HiddenWdg("parent_search_type", search_type)
widget.add(hidden)
hidden = HiddenWdg("parent_search_id", search_id)
widget.add(hidden)
sobject = Search.get_by_id(search_type, search_id)
table = TableWdg(search_type, css="embed")
table.set_show_property(False)
table.set_sobject(sobject)
table.remove_widget("render")
table.remove_widget("description")
widget.add(table)
return widget
示例9: get_render_policy_wdg
def get_render_policy_wdg(my):
widget = Widget()
#div = DivWdg(css="filter_box")
#widget.add(div)
table = TableWdg("prod/render_policy")
search = Search("prod/render_policy")
sobjects = search.get_sobjects()
table.set_sobjects(sobjects)
widget.add(table)
return widget
示例10: get_naming_wdg
def get_naming_wdg(self):
widget = Widget()
#div = DivWdg(css="filter_box")
#widget.add(div)
table = TableWdg("prod/naming")
search = Search("prod/naming")
sobjects = search.get_sobjects()
table.set_sobjects(sobjects)
widget.add(table)
return widget
示例11: get_display
def get_display(self):
if not self.is_refresh:
widget = DivWdg()
self.set_as_panel(widget)
else:
widget = Widget()
sobject = Search.get_by_id(self.search_type, self.search_id)
if sobject:
search_type = sobject.get_base_search_type()
else:
widget.add('sobject not found with [%s,%s]' %(self.search_type, self.search_id))
return widget
# the filter for searching assets
div = DivWdg(css="filter_box")
filter = ProcessSelectWdg(label = 'Process: ', search_type=search_type,\
css='med', has_empty=True)
filter.set_persistence()
filter.add_behavior({'type' : 'change',
'cbjs_action': '%s;%s'%(filter.get_save_script(), filter.get_refresh_script())
})
div.add(filter)
# note assuming process == context here
contexts = filter.get_values()
if contexts:
contexts = contexts[0].split(",")
else:
contexts = None
widget.add(div)
snap_table = TableWdg(Snapshot.SEARCH_TYPE, "publish_browser")
widget.add(snap_table)
# add the search
search = Search(Snapshot.SEARCH_TYPE)
search.add_order_by("version desc")
search.add_sobject_filter(sobject)
if contexts:
search.add_filters("context", contexts)
snap_table.set_sobjects(search.get_sobjects())
snap_table.set_search(search)
return widget
示例12: get_config_wdg
def get_config_wdg(my):
widget = Widget()
search = Search("sthpw/widget_config")
div = DivWdg(css="filter_box")
span = SpanWdg(css="med")
span.add("Search Type: ")
select = FilterSelectWdg("config_search_type")
select.add_empty_option("-- Select --")
search_type_search = Search("sthpw/search_object")
search_type_search.add_order_by("search_type")
span.add(select)
project = Project.get()
project_type = project.get_base_type()
filter = search.get_regex_filter("search_type", "login|task|note|timecard", "EQ")
search_type_search.add_where(
"""
namespace = '%s' or namespace = '%s' or %s
"""
% (project_type, project.get_code(), filter)
)
select.set_search_for_options(search_type_search, value_column="search_type")
div.add(span)
search_type_value = select.get_value()
span = SpanWdg()
view_text = TextWdg("view")
view_text.set_persist_on_submit()
span.add("View: ")
span.add(view_text)
div.add(span)
widget.add(div)
view = view_text.get_value()
if view:
search.add_filter("view", view)
if search_type_value:
search.add_filter("search_type", search_type_value)
table = TableWdg("sthpw/widget_config")
table.set_search(search)
widget.add(table)
return widget
示例13: get_extend_wdg
def get_extend_wdg(self):
widget = Widget()
search = Search("sthpw/widget_extend")
div = DivWdg(css="filter_box")
# add key filter
span = SpanWdg(css="med")
key_select = FilterSelectWdg("key")
key_select.add_empty_option("-- Any Key --")
key_select.set_option("query", "sthpw/widget_extend|key|key")
span.add("Key: ")
span.add(key_select)
div.add(span)
# add type filter
span = SpanWdg(css="med")
select = FilterSelectWdg("extend_type")
select.add_empty_option("-- Any Type --")
select.set_option("values", "TabWdg|TableWdg")
span.add("Widget Extend Type: ")
span.add(select)
div.add(span)
widget.add(div)
extend_type = select.get_value()
if extend_type:
search.add_filter("type", extend_type)
key = key_select.get_value()
if key:
search.add_filter("key", key)
# add project filter
#search.add_where( Project.get_project_filter() )
table = TableWdg("sthpw/widget_extend")
table.set_search( search )
widget.add(table)
return widget
示例14: _get_sobject_wdg
def _get_sobject_wdg(my, search_type):
widget = Widget()
if search_type =="flash/nat_pause":
widget.add(HelpItemWdg('Nat Pause tab', '/doc/flash/nat_pause_tab.html', is_link=True))
div = DivWdg(css="filter_box")
episode_filter = EpisodeNavigatorWdg()
div.add(episode_filter)
div.add(SearchLimitWdg())
widget.add(div)
table = TableWdg(search_type)
table.set_class("table")
widget.add(table)
search = Search(search_type)
episode_code = episode_filter.get_value()
if episode_code:
search.add_filter("episode_code", episode_filter.get_value())
widget.set_search(search)
return widget
示例15: get_display
def get_display(my):
args = WebContainer.get_web().get_form_args()
# get the args in the URL
search_type = args['search_type']
search_id = args['search_id']
sobject = Search.get_by_search_key("%s|%s" % (search_type,search_id) )
widget = DivWdg()
widget.add_style("width: 95%")
widget.add_style("margin-left: 20px")
table = TableWdg("sthpw/task", "layout_right")
from pyasm.biz import Task
tasks = Task.get_by_sobject(sobject)
table.set_sobjects(tasks)
table.set_show_property(False)
widget.add(table)
return widget