当前位置: 首页>>代码示例>>Python>>正文


Python TextWdg.set_persistence方法代码示例

本文整理汇总了Python中pyasm.widget.TextWdg.set_persistence方法的典型用法代码示例。如果您正苦于以下问题:Python TextWdg.set_persistence方法的具体用法?Python TextWdg.set_persistence怎么用?Python TextWdg.set_persistence使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyasm.widget.TextWdg的用法示例。


在下文中一共展示了TextWdg.set_persistence方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_new_tab_wdg

# 需要导入模块: from pyasm.widget import TextWdg [as 别名]
# 或者: from pyasm.widget.TextWdg import set_persistence [as 别名]
    def get_new_tab_wdg(self):
        widget = Widget()

        span = SpanWdg()
        swap = SwapDisplayWdg.get_triangle_wdg()
        title = SpanWdg("Tab Creation")
        span.add(swap)
        span.add(title)
        span.add_style("float: left")
        widget.add(span)
        widget.add(HtmlElement.br() )

        # add the tab selector
        div = DivWdg()
        SwapDisplayWdg.create_swap_title( title, swap, div)

        tab_text = TextWdg("tab")
        tab_text.set_persistence()
        span = SpanWdg(css="med")
        span.add("Tab: ")
        span.add(tab_text)
        div.add(span)

        # parent
        index_text = TextWdg("parent_tab")
        index_text.set_persistence()
        span = SpanWdg(css="med")
        span.add("Parent Tab: ")
        span.add(index_text)
        span.add(HintWdg("Enter the name of the tab that this will fall under. Leave empty to put on the main tab") )
        div.add(span)


        # index
        index_text = TextWdg("index")
        index_text.set_attr("size", "4")
        index_text.set_persistence()
        span = SpanWdg(css="med")
        span.add("Index: ")
        span.add(index_text)
        span.add(HintWdg("Enter the numeric location for this tab to be placed") )
        div.add(span)

        WebContainer.register_cmd("CreateTabCmd")
        button = IconSubmitWdg("Create Tab", IconWdg.CREATE, True)
        div.add(button)

        widget.add(div)

        return widget
开发者ID:mincau,项目名称:TACTIC,代码行数:52,代码来源:custom_view_app_wdg.py

示例2: init

# 需要导入模块: from pyasm.widget import TextWdg [as 别名]
# 或者: from pyasm.widget.TextWdg import set_persistence [as 别名]
    def init(my):

        search = Search("sthpw/queue")
        search.add_order_by("priority desc")
        search.add_order_by("timestamp desc")

        widget = Widget()

        div = DivWdg(css="filter_box")

        span = SpanWdg(css="med")

        from pyasm.prod.web import SearchFilterWdg

        search_filter = SearchFilterWdg(columns=Queue.get_search_columns())
        search_filter.alter_search(search)
        span.add(search_filter)
        div.add(span)

        span = SpanWdg(css="med")
        priority_wdg = TextWdg("priority_search")
        priority_wdg.set_persistence()
        priority = priority_wdg.get_value()
        if priority:
            search.add_filter("priority", priority)
        span.add("Priority: ")
        span.add(priority_wdg)
        div.add(span)

        select = SelectWdg("queue_state")
        select.set_option("values", "|pending|locked|error|done")
        select.set_option("labels", "All|pending|locked|error|done")
        select.add_event("onchange", "document.form.submit()")
        select.set_persistence()

        span = SpanWdg(css="med")
        span.add("State: ")
        span.add(select)
        div.add(span)
        queue_state = select.get_value()
        if queue_state != "":
            search.add_filter("state", queue_state)

        user_select = SelectWdg("user_select")
        user_select.add_empty_option()

        user_search = Search("sthpw/login")
        user_select.set_search_for_options(user_search, "login", "login")
        user_select.add_event("onchange", "document.form.submit()")
        user_select.set_persistence()

        div.add("User: ")
        div.add(user_select)
        queue_user = user_select.get_value()
        if queue_user != "":
            search.add_filter("login", queue_user)

        search_limit = SearchLimitWdg()
        search_limit.set_limit(10)
        div.add(search_limit)
        search_limit.alter_search(search)

        widget.add(div)

        sobjects = search.get_sobjects()

        table = TableWdg("sthpw/queue")
        table.set_sobjects(sobjects)
        widget.add(table)

        my.add(widget)
开发者ID:pombredanne,项目名称:TACTIC,代码行数:73,代码来源:queue_wdg.py


注:本文中的pyasm.widget.TextWdg.set_persistence方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。