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


Python CheckboxWdg.get_value方法代码示例

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


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

示例1: get_checkboxes_section

# 需要导入模块: from pyasm.widget import CheckboxWdg [as 别名]
# 或者: from pyasm.widget.CheckboxWdg import get_value [as 别名]
    def get_checkboxes_section(outer_div):
        checkboxes_div = DivWdg()

        bigboard_wdg = CheckboxWdg('bigboard', 'Hot Title?')
        no_charge_wdg = CheckboxWdg('no_charge', 'No Charge')
        redo_wdg = CheckboxWdg('redo', 'Redo')
        repurpose_wdg = CheckboxWdg('repurpose', 'Repurpose')

        bigboard_wdg.get_value()

        checkboxes_div.add(bigboard_wdg)
        checkboxes_div.add(no_charge_wdg)
        checkboxes_div.add(redo_wdg)
        checkboxes_div.add(repurpose_wdg)

        outer_div.add(checkboxes_div)
开发者ID:2gDigitalPost,项目名称:custom,代码行数:18,代码来源:order_title_builder.py

示例2: ArtistViewWdg

# 需要导入模块: from pyasm.widget import CheckboxWdg [as 别名]
# 或者: from pyasm.widget.CheckboxWdg import get_value [as 别名]
class ArtistViewWdg(SpanWdg):

    def init(self):
        self.add("Show assigned only: ")
        self.checkbox = CheckboxWdg("show_assigned_only")
        self.checkbox.set_option("value", "on")
        self.checkbox.set_persistence()
        self.checkbox.add_event("onclick", "document.form.submit()")
        self.add(self.checkbox)


        self.add_class("med")



    def is_supervisor(self):
        # if the user is a supervisor, look at all of the assets
        project = Project.get_project_name()
        security = Environment.get_security()
        return security.check_access("prod/%s" % project, "model/supervisor", "true")

    def is_artist(self):
        # if the user is a artist, look at all of the assets
        project = Project.get_project_name()
        security = Environment.get_security()
        return security.check_access("prod/%s" % project, "model/artist", "true")


    def alter_search(self, search):

        # get all of the relevant tasks to the user
        task_search = Search("sthpw/task")
        task_search.add_column("search_id")

        # only look at this project
        project = Project.get_project_name()
        task_search.add_filter("search_type", search.get_search_type())

        # figure out who the user is
        security = Environment.get_security()
        login = security.get_login()
        user = login.get_value("login")



        print "is_artist: ", self.is_artist()
        print "is_supervisor: ", self.is_supervisor()


        # do some filtering
        web = WebContainer.get_web()
        show_assigned_only = self.checkbox.get_value()
        show_process = web.get_form_values("process")
        if not show_process or show_process[0] == '':
            show_process = []

        show_task_status = web.get_form_values("task_status")
        if not show_task_status or show_task_status[0] == '':
            show_task_status = []


        if show_assigned_only == "on":
            task_search.add_filter("assigned", user)

        if show_process:
            where = "process in (%s)" % ", ".join( ["'%s'" % x for x in show_process] )
            task_search.add_where(where)

        if show_task_status:
            where = "status in (%s)" % ", ".join( ["'%s'" % x for x in show_task_status] )
            task_search.add_where(where)
        else:
            task_search.add_where("NULL")




        # record the tasks
        self.tasks = task_search.get_sobjects()

        # get all of the sobject ids
        sobject_ids = ["'%s'" % x.get_value("search_id") for x in self.tasks]

        # get all of the sobjects related to this task
        if sobject_ids:
            search.add_where( "id in (%s)" % ", ".join(sobject_ids) )
开发者ID:mincau,项目名称:TACTIC,代码行数:88,代码来源:artist_view_wdg.py


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