• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python widget.SelectWdg类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: get_sync_mode_wdg

    def get_sync_mode_wdg(self):

        div = DivWdg()
        div.add_class("spt_sync_mode")

        div.add("Share Mode: ")
        select = SelectWdg("sync_mode")
        div.add(select)
        select.set_option("values", "file|xmlrpc")

        select.add_behavior( {
            'type': 'change',
            'cbjs_action': '''
            var top = bvr.src_el.getParent(".spt_sync_mode");
            var value = bvr.src_el.value;
            var xmlrpc_el = top.getElement(".spt_xmlrpc_mode");
            var file_el = top.getElement(".spt_file_mode");

            if (value == 'xmlrpc') {
                spt.show(xmlrpc_el);
                spt.hide(file_el);
            }
            else {
                spt.hide(xmlrpc_el);
                spt.show(file_el);
            }
            '''
        } )

        div.add( self.get_xmlrpc_mode_wdg() )
        div.add( self.get_file_mode_wdg() )

        return div
开发者ID:mincau,项目名称:TACTIC,代码行数:33,代码来源:sync_settings_wdg.py


示例2: get_display

    def get_display(my):
        widget = DivWdg(id='link_view_select')
        widget.add_class("link_view_select")
        if my.refresh:
            widget = Widget()
        else:
            my.set_as_panel(widget)
        
        views = []
        if my.search_type:
            from pyasm.search import WidgetDbConfig
            search = Search( WidgetDbConfig.SEARCH_TYPE )
            search.add_filter("search_type", my.search_type)
            search.add_regex_filter("view", "link_search:|saved_search:", op="NEQI")
            search.add_order_by('view')
            widget_dbs = search.get_sobjects()
            views = SObject.get_values(widget_dbs, 'view')
        
        labels = [view for view in views]

        views.insert(0, 'table')
        labels.insert(0, 'table (Default)')
        st_select = SelectWdg('new_link_view', label='View: ')
        st_select.set_option('values', views)
        st_select.set_option('labels', labels)
        widget.add(st_select)
        return widget
开发者ID:blezek,项目名称:TACTIC,代码行数:27,代码来源:view_manager_wdg.py


示例3: get_display

    def get_display(self):
        outer_div = DivWdg()
        outer_div.set_id('new-department-request-entry-form')

        page_label = "<div>Fill out the following form to submit a new request. The request will be added to the " \
                     "department's list, and will be addressed as soon as possible. You will receive a " \
                     "notification when the request is complete.</div><br/>"
        outer_div.add(page_label)

        outer_div.add(get_label_widget('Name'))
        outer_div.add(get_text_input_wdg('name', 800))

        outer_div.add(get_label_widget('Description'))
        outer_div.add(obu.get_text_area_input_wdg('description', 800, [('display', 'block')]))

        outer_div.add(get_label_widget('Due Date'))
        outer_div.add(get_datetime_calendar_wdg())

        department_select_wdg = SelectWdg('department_select')
        department_select_wdg.append_option('Onboarding', 'onboarding')
        department_select_wdg.append_option('Edel', 'edel')
        department_select_wdg.append_option('Compression', 'compression')
        department_select_wdg.append_option('QC', 'qc')

        outer_div.add(get_label_widget('Department'))
        outer_div.add(department_select_wdg)

        self.get_submit_widget(outer_div)

        return outer_div
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:30,代码来源:department_request_wdg.py


示例4: get_display

    def get_display(self):
        div_wdg = DivWdg()

        current_code_div = DivWdg()
        component_code = self.file_flow_sobject.get('component_code')

        component_sobject = get_sobject_by_code('twog/component', component_code)
        current_code_div.add('Current Component set to {0} ({1})'.format(component_sobject.get('name'),
                                                                         component_code))

        order_sobject = get_order_sobject_from_component_sobject(component_sobject)
        component_sobjects_for_order = get_component_sobjects_from_order_code(order_sobject.get_code())

        component_select_wdg = SelectWdg()
        component_select_wdg.set_id('component_select')
        component_select_wdg.add_style('width: 165px;')
        component_select_wdg.add_empty_option()

        for component in component_sobjects_for_order:
            component_select_wdg.append_option(component.get('name'), component.get_code())

        div_wdg.add(current_code_div)
        div_wdg.add(component_select_wdg)

        return div_wdg
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:25,代码来源:change_component_for_file_flow_wdg.py


示例5: get_display

    def get_display(my):

        widget = Widget()

        div = DivWdg(css="filter_box")

        show_span = SpanWdg(css="med")
        show_span.add("Show All Types: ")
        checkbox = FilterCheckboxWdg("show_all_types")
        checkbox.set_persistence()
        show_span.add(checkbox)
        show_all_types = checkbox.get_value()
        div.add(show_span)

        span = SpanWdg(css="med")
        span.add("Search Type: ")

        select = SelectWdg("filter|search_type")
        select.add_empty_option("-- Select --")
        project = Project.get()
        project_type = project.get_base_type()
        search = Search("sthpw/search_object")
        if show_all_types:
            search.add_where(
                """
            namespace = '%s' or namespace = '%s' or search_type in ('sthpw/task')
            """
                % (project_type, project.get_code())
            )
        else:
            # show only the custom ones
            search.add_filter("namespace", project.get_code())

        search.add_order_by("title")
        sobjects = search.get_sobjects()

        select.set_sobjects_for_options(sobjects, "search_type", "title")
        # select.set_option("query", "sthpw/search_object|search_type|title")
        select.set_persistence()
        select.add_event("onchange", "document.form.submit()")
        search_type = select.get_value()
        span.add(select)
        div.add(span)

        # make sure the current selection exists
        try:
            SearchType.get(search_type)
        except SearchException, e:
            return div
开发者ID:hellios78,项目名称:TACTIC,代码行数:49,代码来源:custom_view_app_wdg.py


示例6: get_file_in_package_status_select

def get_file_in_package_status_select():
    task_status_select = SelectWdg('file_status_select')
    task_status_select.set_id('file_status_select')
    task_status_select.add_style('width: 165px;')
    task_status_select.add_empty_option()

    pipeline = Pipeline.get_by_code('twog_Delivery')

    for status in pipeline.get_process_names():
        task_status_select.append_option(status, status)

    return task_status_select
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:12,代码来源:change_status_wdg.py


示例7: get_title_select_wdg

def get_title_select_wdg(width=300):
    title_select_wdg = SelectWdg('title_code')
    title_select_wdg.set_id('title_code')
    title_select_wdg.add_style('width', '{0}px'.format(width))
    title_select_wdg.add_empty_option()

    title_search = Search('twog/title')
    titles = title_search.get_sobjects()

    for title in titles:
        title_select_wdg.append_option(title.get_value('name'), title.get_code())

    return title_select_wdg
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:13,代码来源:insert_component_in_order_wdg.py


示例8: get_display

    def get_display(my):
        return ''

        search_types = 'MMS/discipline.MMS/product_type'.split(".")

        top = DivWdg()
        parents = None
        for search_type in search_types:

            if not parents:
                search = Search(search_type)
                sobjects = search.get_sobjects()

                columns = search.get_columns()
                column = columns[1]

                select = SelectWdg(search_type)
                select.set_option("values", [x.get_id() for x in sobjects] )
                select.set_option("labels", [x.get_value(column) for x in sobjects] )
                top.add(select)
            else:
                for parent in parents:

                    search = Search(search_type)
                    search.add_relationship_filter(parent)
                    sobjects = search.get_sobjects()

                    if not sobjects:
                        continue

                    columns = search.get_columns()
                    column = columns[1]


                    values = [x.get_id() for x in sobjects]
                    labels = [x.get_value(column) for x in sobjects]


                    select = SelectWdg(search_type)
                    select.add_attr("spt_input_key", parent.get_id() )
                    select.set_option("values", values )
                    select.set_option("labels", labels )
                    top.add(select)

            parents = sobjects
        return top
开发者ID:CeltonMcGrath,项目名称:TACTIC,代码行数:46,代码来源:misc_input_wdg.py


示例9: get_security_wdg

    def get_security_wdg(self):

        div = DivWdg()
        div.add_class("spt_security")

        div.add("A server can sync either be scoped for a single project or all projects.  Transactions that occur in the admin project never get synced.")

        div.add("<br/>"*2)

        div.add("Project: ")

        search = Search("sthpw/project")
        search.add_filters("code", ['admin','unittest'], op='not in')
        search.add_order_by("title")
        projects = search.get_sobjects()

        select = SelectWdg("projects")
        div.add(select)
        labels = [x.get_value("title") for x in projects]
        values = [x.get_value("code") for x in projects]

        project_code = Project.get_project_code()
        if project_code != 'admin':
            select.set_value(project_code)
        select.set_option("labels", labels)
        select.set_option("values", values)
        select.add_empty_option("-- All --")


        div.add("<br/>"*2)

        return div
开发者ID:mincau,项目名称:TACTIC,代码行数:32,代码来源:sync_settings_wdg.py


示例10: get_assigned_select

 def get_assigned_select(my, assigned):
     # Make the select element for workers
     workers_expr = "@GET(sthpw/login['location','internal']['license_type','user'].login)"
     workers = my.server.eval(workers_expr)
     work_sel = SelectWdg('task_assigned_select')
     if len(workers) > 0:
         work_sel.append_option('--Select--', '')
         if assigned:
             work_sel.set_value(assigned)
         else:
             work_sel.set_value('')
         for worker in workers:
             work_sel.append_option(worker, worker)
     return work_sel
开发者ID:2gDigitalPost,项目名称:custom,代码行数:14,代码来源:quick_edit_wdg.py


示例11: get_assigned_group_select

 def get_assigned_group_select(my, assigned, name):
     # Make the select element for groups
     groups_expr = "@GET(sthpw/login_group['login_group','not in','user|client|compression supervisor|edit supervisor|machine room supervisor|media vault supervisor|qc supervisor|sales supervisor|scheduling supervisor|streamz|executives|admin|management|office employees|it'].login_group)"
     groups = my.server.eval(groups_expr)
     group_sel = SelectWdg(name)
     if len(groups) > 0:
         group_sel.append_option('--Select--', '')
         if assigned:
             group_sel.set_value(assigned)
         else:
             group_sel.set_value('')
         for group in groups:
             group_sel.append_option(group, group)
     return group_sel
开发者ID:2gDigitalPost,项目名称:custom,代码行数:14,代码来源:quick_edit_wdg.py


示例12: get_display

    def get_display(my):
        sobject = my.get_current_sobject()
        key = sobject.get_value("key")
        options = sobject.get_value("options")
        type = sobject.get_value("type")

        # get the value of the users preferences
        search = Search("sthpw/pref_setting")
        search.add_user_filter()
        search.add_filter("key", key)
        pref_setting = search.get_sobject()
        if pref_setting:
            value = pref_setting.get_value("value")
        else:
            value = ""

        div = DivWdg()

        element_name = "%s_%s" % (my.get_name(), sobject.get_id() )
      
        script = '''var server = TacticServerStub.get();
                var value = bvr.src_el.value;
                if (!value) return;

                spt.app_busy.show("Saving", "Saving Preference for [%s]");

                setTimeout( function() {
                    try{
                        server.execute_cmd('tactic.ui.table.SetPreferenceCmd', {key: '%s', value: value});
                    }catch(e){
                        spt.alert(spt.exception.handler(e));
                    }
                        
                    spt.app_busy.hide() 
                        
                    }, 200);'''%(key, key)

        if key in ['skin', 'palette', 'js_logging_level']:
            script = '''%s; spt.app_busy.show('Reloading Page ...'); setTimeout('spt.refresh_page()', 200);'''%script

        if type == "sequence":
            from pyasm.prod.web import SelectWdg
            select = SelectWdg(element_name)
            select.add_behavior({'type': "change", 
                'cbjs_action': script})

            select.set_option("values",options)
            if value:
                select.set_value(value)
            div.add(select)
        else:
            text = TextWdg(element_name)
            text.add_behavior({'type': "blur", 
                'cbjs_action': script})
            if value:
                text.set_value(value)
            div.add(text)
     
        return div
开发者ID:0-T-0,项目名称:TACTIC,代码行数:59,代码来源:preference_wdg.py


示例13: get_language_select_wdg

def get_language_select_wdg():
    language_select_wdg = SelectWdg('language_code')
    language_select_wdg.set_id('language_code')
    language_select_wdg.add_style('display', 'inline-block')
    language_select_wdg.add_empty_option()

    language_search = Search('twog/language')
    languages = language_search.get_sobjects()

    languages = sorted(languages, key=lambda x: x.get_value('name'))

    for language in languages:
        language_select_wdg.append_option(language.get_value('name'), language.get_code())

    return language_select_wdg
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:15,代码来源:insert_component_in_order_wdg.py


示例14: get_sel

 def get_sel(my, id_name, arr, default, alpha_sort):
     this_sel = SelectWdg(id_name)
     this_sel.add_attr('id',id_name)
     if default not in arr and default not in [None,'']:
         arr.append(default)
     if alpha_sort:
         arr.sort()
     arr2 = []
     for a in arr:
         arr2.append(a)
     this_sel.append_option('--Select--','')
     for a in arr2:
         this_sel.append_option(a,a)
     this_sel.set_value(default)
     return this_sel
开发者ID:2gDigitalPost,项目名称:custom,代码行数:15,代码来源:ticketing.py


示例15: get_select_wdg

    def get_select_wdg(name, options, saved_value=None):
        select_wdg = SelectWdg(name)
        select_wdg.set_id(name)
        select_wdg.add_empty_option()

        for option_set in options:
            label = option_set[0]
            value = option_set[1]

            select_wdg.append_option(label, value)

        if saved_value:
            select_wdg.set_value(saved_value)

        return select_wdg
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:15,代码来源:prequal_eval_lines_wdg.py


示例16: get_assigned_select

 def get_assigned_select(self, assigned):
     workers_search = Search("sthpw/login")
     workers_search.add_filter('location', 'internal')
     workers_search.add_filter('license_type', 'user')
     workers = workers_search.get_sobjects()
     work_sel = SelectWdg('task_assigned_select')
     if len(workers) > 0:
         work_sel.append_option('--Select--', '')
         if assigned:
             work_sel.set_value(assigned)
         else:
             work_sel.set_value('')
         for worker in workers:
             work_sel.append_option(worker.get_value('login'), worker.get_value('login'))
     return work_sel
开发者ID:2gDigitalPost,项目名称:custom,代码行数:15,代码来源:task_edit_widget.py


示例17: get_description_select_wdg

    def get_description_select_wdg(name, value=None):
        select_wdg = SelectWdg(name)
        select_wdg.set_id(name)
        select_wdg.add_empty_option()

        description_search = Search('twog/prequal_line_description')
        descriptions = description_search.get_sobjects()

        for description in descriptions:
            select_wdg.append_option(description.get_value('name'), description.get_code())

        if value:
            select_wdg.set_value(value)

        return select_wdg
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:15,代码来源:prequal_eval_lines_wdg.py


示例18: get_assigned_group_select

    def get_assigned_group_select(self, assigned):
        where_str = "('user','client','compression supervisor','edit supervisor','machine room supervisor','media vault supervisor','qc supervisor','sales supervisor','scheduling supervisor','streamz','executives','admin','management','office employees','it')"
        group_search = Search("sthpw/login_group")
        group_search.add_where("\"login_group\" not in %s" % where_str)
        groups = group_search.get_sobjects()

        group_sel = SelectWdg('task_assigned_group_select')
        if len(groups) > 0:
            group_sel.append_option('--Select--', '')
            if assigned:
                group_sel.set_value(assigned)
            else:
                group_sel.set_value('')
            for group in groups:
                group_sel.append_option(group.get_value('login_group'), group.get_value('login_group'))
        return group_sel
开发者ID:2gDigitalPost,项目名称:custom,代码行数:16,代码来源:task_edit_widget.py


示例19: get_file_select_wdg_from_file_list

def get_file_select_wdg_from_file_list(files, width=400):
    """
    Given a list of file sobjects, return a SelectWdg using the file paths and codes

    :param files: List of file sobjects
    :param width: Width of the SelectWdg
    :return: SelectWdg
    """
    file_select_wdg = SelectWdg('file_select')
    file_select_wdg.set_id('file_select')
    file_select_wdg.add_style('width', '{0}px'.format(width))
    file_select_wdg.add_empty_option()

    for file_sobject in files:
        file_select_wdg.append_option(file_sobject.get('file_path'), file_sobject.get_code())

    return file_select_wdg
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:17,代码来源:input_widgets.py


示例20: get_select_widget_from_search_type

def get_select_widget_from_search_type(search_type, label, label_column, value_column, search_filters=None,
                                       search_order_bys=None):
    """
    Given a search_type, create a SelectWdg. Provide label, label_column, and value_column to set the SearchWdg
    attributes. If filters are given, apply those to the search as well.

    :param search_type: s_type ('twog/title' for example)
    :param label: String, set as 'label' on the select html element
    :param label_column: String, the database column to use for the option labels
    :param value_column: String, the database column to use for the option values
    :param search_filters: A list of tuples containing search filters (optional)
    :param search_order_bys: A list of strings corresponding to database columns to sort by (optional)
    :return: SelectWdg
    """
    search = Search(search_type)

    if search_filters:
        for search_filter in search_filters:
            filter_name = search_filter[0]
            filter_value = search_filter[1]

            try:
                filter_operator = search_filter[2]
            except IndexError:
                filter_operator = None

            if filter_operator:
                search.add_filter(filter_name, filter_value, filter_operator)
            else:
                search.add_filter(filter_name, filter_value)

    if search_order_bys:
        for search_order_by in search_order_bys:
            search.add_order_by(search_order_by)

    search_wdg = SelectWdg(label)
    search_wdg.add_empty_option('----')
    search_wdg.set_search_for_options(search, label_column=label_column, value_column=value_column)

    return search_wdg
开发者ID:2gDigitalPost,项目名称:custom,代码行数:40,代码来源:order_builder_utils.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python widget.TableWdg类代码示例发布时间:2022-05-25
下一篇:
Python widget.IconWdg类代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap