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


Python Table.add_attr方法代码示例

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


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

示例1: get_display

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_attr [as 别名]
    def get_display(my):
        sobject = my.get_current_sobject()
        code = sobject.get_code()
        sk = my.server.build_search_key("twog/movement", code)
        shipping_class = sobject.get_value("shipping_class")
        title = sobject.get_value("name")
        waybill = sobject.get_value("waybill")
        sending_company_code = sobject.get_value("sending_company_code")
        receiving_company_code = sobject.get_value("receiving_company_code")
        shipper_code = sobject.get_value("shipper_code")
        description = sobject.get_value("description")
        timestamp = sobject.get_value("timestamp")

        widget = DivWdg()
        table = Table()
        table.add_attr("width", "50px")
        table.add_row()
        cell1 = table.add_cell(
            '<img border="0" style="vertical-align: middle" title="" src="/context/icons/silk/printer.png">'
        )
        launch_behavior = my.get_launch_behavior()
        cell1.add_attr("sk", sk)
        cell1.add_attr("shipping_class", shipping_class)
        cell1.add_attr("to_comp", receiving_company_code)
        cell1.add_attr("from_comp", sending_company_code)
        cell1.add_attr("waybill", waybill)
        cell1.add_attr("title", title)
        cell1.add_attr("shipper", shipper_code)
        cell1.add_attr("description", description)
        cell1.add_attr("timestamp", timestamp)
        cell1.add_style("cursor: pointer;")
        cell1.add_behavior(launch_behavior)
        widget.add(table)

        return widget
开发者ID:2gDigitalPost,项目名称:custom,代码行数:37,代码来源:movement_printer2.py

示例2: get_display

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_attr [as 别名]
    def get_display(my):
        #--print "IN OBLW"
        code = ''
        if 'search_key' in my.kwargs.keys():
            search_key = str(my.kwargs.get('search_key'))
            code = search_key.split('code=')[1]
            search_type = search_key.split('?')[0]
            sob_platform = my.server.eval("@GET(%s['code','%s'].platform)" % (search_type, code))
        else: 
            sobject = my.get_current_sobject()
            code = sobject.get_code()
            sob_platform = sobject.get_value('platform')

        platform_sk = ''
        if sob_platform not in [None,'']:
            platform_sk = my.server.eval("@GET(twog/platform['name','%s'].__search_key__)" % sob_platform)
            if len(platform_sk) > 0:
                platform_sk = platform_sk[0]
            else:
                platform_sk = ''
            
        widget = DivWdg()
        table = Table()
        if platform_sk not in [None,'']:
            table.add_attr('width', '50px')
            table.add_row()
            cell1 =  table.add_cell('<img border="0" style="vertical-align: middle" title="" src="/context/icons/silk/email.png">')
            launch_behavior = my.get_launch_behavior(platform_sk)
            cell1.add_style('cursor: pointer;')
            cell1.add_behavior(launch_behavior)
        widget.add(table)

        return widget
开发者ID:Smurgledwerf,项目名称:custom,代码行数:35,代码来源:platform_tools.py

示例3: get_display

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_attr [as 别名]
 def get_display(my):
     sobject = my.get_current_sobject()
     sk = sobject.get_search_key()
     widget = DivWdg()
     sts_to_perm = {'twog/qc_report_vars': 'compression|qc supervisor|edeliveries'}
     if '-1' not in sk:
         table = Table()
         table.add_attr('width', '50px')
         login = Environment.get_login()
         user_name = login.get_login()
         groups = Environment.get_group_names()
         st = sk.split('?')[0]; 
         perms = sts_to_perm[st] 
         allow = False
         for g in groups:
             if g in perms:
                 allow = True
         if user_name == 'admin':
             allow = True
         if allow:
             table.add_row()
             cell1 =  table.add_cell(my.x_butt)
             cell1.add_attr('id','sp_del_%s' % sk)
             launch_behavior = my.get_delete_behavior(sk)
             cell1.add_style('cursor: pointer;')
             cell1.add_behavior(launch_behavior)
             widget.add(table)
     return widget
开发者ID:2gDigitalPost,项目名称:custom,代码行数:30,代码来源:special_delete.py

示例4: get_display

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_attr [as 别名]
 def get_display(my):
     widget = DivWdg()
     table = Table()
     table.add_attr('class','my_preferences_wdg')
    
     prefs = my.login_obj.get('twog_preferences').split(',')
     for pref in prefs:
         if pref not in [None,'']:
             kv = pref.split('=')
             key = kv[0]
             val = kv[1]
             table.add_row()
             desc = table.add_cell(my.key_dict[key])
             desc.add_attr('nowrap','nowrap')
             this_sel = SelectWdg(key)
             this_sel.add_attr('id',key)
             this_sel.add_style('width: 100px;')
             this_sel.append_option('True','true')
             this_sel.append_option('False','false')
             this_sel.set_value(val)
             table.add_cell(this_sel)
     table.add_row()
     t2 = Table()
     t2.add_row()
     t2.add_cell()
     tc = t2.add_cell('<input type="button" name="Save My Preferences" value="Save My Preferences"/>')
     tc.add_attr('width', '50px')
     tc.add_behavior(my.get_save_preferences())
     t2.add_cell()
     table.add_cell(t2)
     widget.add(table)
     return widget
开发者ID:2gDigitalPost,项目名称:custom,代码行数:34,代码来源:preferences.py

示例5: get_display

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_attr [as 别名]
    def get_display(my):
        sobject = my.get_current_sobject()
        code = sobject.get_code()
        sk = my.server.build_search_key('twog/movement', code)
        shipping_class = sobject.get_value('shipping_class')
        title = sobject.get_value('name')
        waybill = sobject.get_value('waybill')
        sending_company_code = sobject.get_value('sending_company_code')
        receiving_company_code = sobject.get_value('receiving_company_code')
        shipper_code = sobject.get_value('shipper_code')
        description = sobject.get_value('description')
        timestamp = sobject.get_value('timestamp')
        
        widget = DivWdg()
        table = Table()
        table.add_attr('width', '50px')
        table.add_row()
        cell1 = table.add_cell('<img border="0" style="vertical-align: middle" title="" src="/context/icons/silk/printer.png">')
        launch_behavior = my.get_launch_behavior()
        cell1.add_attr('sk',sk)
        cell1.add_attr('shipping_class',shipping_class)
        cell1.add_attr('to_comp',receiving_company_code)
        cell1.add_attr('from_comp',sending_company_code)
        cell1.add_attr('waybill',waybill)
        cell1.add_attr('title',title)
        cell1.add_attr('shipper',shipper_code)
        cell1.add_attr('description',description)
        cell1.add_attr('timestamp',timestamp)
        cell1.add_style('cursor: pointer;')
        cell1.add_behavior(launch_behavior)
        widget.add(table)

        return widget
开发者ID:Smurgledwerf,项目名称:custom,代码行数:35,代码来源:movement_printer2.py

示例6: get_display

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_attr [as 别名]
 def get_display(my):
     widget = DivWdg()
     table = Table()
     table.add_attr('class','scraper')
     table.add_row()
     tb = TextWdg('title_box')
     tb.add_attr('id','title_box')
     multiple_titles = None
     print "MY.TITLE_OF_SHOW = %s" % my.title_of_show
     if my.title_of_show not in [None,'']:
         tb.set_value(my.title_of_show)
         #poster_url_text = my.get_poster_url(my.title_of_show)
         #poster_url = poster_url_text.split('=')[1]
         multiple_titles = my.get_multiple_title_info(my.title_of_show)
     print "MULTIPLE_TITLES = %s" % multiple_titles
     tb.add_behavior(my.get_search())
     table.add_cell(tb)
     if multiple_titles not in [None,''] and len(multiple_titles) > 0:
         for m in multiple_titles:
             table.add_row()
             table.add_cell('<img src="%s"/>' % m['TopLevel']['poster'])
             mkeys = m.keys()
             for k in mkeys: 
                 table.add_row()
                 table.add_cell('<b><u>%s</u></b>' % k)
                 dudes = m[k]
                 dkeys = dudes.keys()
                 for d in dkeys:
                     table.add_row()
                     table.add_cell('%s: %s' % (d, dudes[d])) 
     widget.add(table)
     return widget
开发者ID:Smurgledwerf,项目名称:custom,代码行数:34,代码来源:scraper.py

示例7: get_display

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_attr [as 别名]
 def get_display(my):
     do_button = False
     if 'work_order_code' not in my.kwargs.keys(): 
         sobject = my.get_current_sobject()
         code = sobject.get_code()
     else:
         code = my.kwargs.get('work_order_code')    
         do_button = True
     
     widget = DivWdg()
     table = Table()
     table.add_attr('width', '50px')
     table.add_row()
     launch_behavior = my.get_launch_behavior(code)
     what_goes_in = '<img border="0" style="vertical-align: middle" title="" src="/context/icons/silk/printer.png">'
     if do_button:
        what_goes_in = ButtonSmallNewWdg(title="Print Work Order", icon=IconWdg.PRINTER)
        what_goes_in.add_behavior(launch_behavior) 
     cell1 = table.add_cell(what_goes_in)
     cell1.add_attr('code',code)
     cell1.add_style('cursor: pointer;')
     if not do_button:
         cell1.add_behavior(launch_behavior)
     widget.add(table)
     if do_button:
         return what_goes_in
     else:
         return widget
开发者ID:2gDigitalPost,项目名称:custom,代码行数:30,代码来源:work_order_printer.py

示例8: get_display

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_attr [as 别名]
 def get_display(my):
     sob_sk = ''
     name = ''
     height = 20
     if 'sk' in my.kwargs.keys():
         sob_sk = str(my.kwargs.get('sk'))
     else: 
         sobject = my.get_current_sobject()
         sob_sk = sobject.get_search_key() 
     if 'name' in my.kwargs.keys():
         name = my.kwargs.get('name')
         if 'height' in my.kwargs.keys():
             height = my.kwargs.get('height') 
     processes = ''
     if 'processes' in my.kwargs.keys():
         processes = my.kwargs.get('processes')
         
     widget = DivWdg()
     table = Table()
     table.add_attr('width', '50px')
     table.add_row()
     cell1 = None
     if name == '':
         cell1 = table.add_cell('<img border="0" style="vertical-align: middle" title="" src="/context/icons/silk/_spt_upload.png">')
     else:
         cell1 = table.add_cell('<input type="button" value="%s" style="height: %spx"/>' % (name, height))
     cell1.add_attr('sk', sob_sk)
     cell1.add_attr('processes', processes)
     launch_behavior = my.get_launch_behavior()
     cell1.add_style('cursor: pointer;')
     cell1.add_behavior(launch_behavior)
     widget.add(table)
     return widget
开发者ID:2gDigitalPost,项目名称:custom,代码行数:35,代码来源:uploader.py

示例9: get_display

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_attr [as 别名]
    def get_display(my):
        from tactic_client_lib import TacticServerStub

        sobject = None
        code = ""
        if "source_code" in my.kwargs.keys():
            code = str(my.kwargs.get("source_code"))
        else:
            sobject = my.get_current_sobject()
            code = sobject.get_code()
        widget = DivWdg()
        table = Table()
        table.add_attr("width", "50px")
        login = Environment.get_login()
        user_name = login.get_login()
        table.add_row()
        cell1 = table.add_cell(
            '<img border="0" style="vertical-align: middle" title="Clone Source" name="Clone Source" src="/context/icons/silk/star.png">'
        )
        cell1.add_attr("user", user_name)
        launch_behavior = my.get_launch_behavior(code, user_name)
        cell1.add_style("cursor: pointer;")
        cell1.add_behavior(launch_behavior)
        widget.add(table)

        return widget
开发者ID:2gDigitalPost,项目名称:custom,代码行数:28,代码来源:source_cloner.py

示例10: get_display

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_attr [as 别名]
    def get_display(my):
        sobject = None
        if 'order_code' in my.kwargs.keys():
            my.order_code = my.kwargs.get('order_code')
        else:
            sobject = my.get_current_sobject()
            my.order_code = sobject.get_code()
        sobject = my.server.eval("@SOBJECT(twog/order['code','%s'])" % my.order_code)[0]
        my.order_name = sobject.get('name')
        widget = DivWdg()
        table = Table()
        table.add_attr('width', '50px')
        login = Environment.get_login()
        user_name = login.get_login()
        table.add_row()
        cell1 = table.add_cell('<b><u>Calculate Costs</u></b>')
        cell1.add_attr('order_code', my.order_code)
        cell1.add_attr('user', user_name)
        cell1.add_attr('order_name', my.order_name)
        cell1.add_attr('nowrap','nowrap')
        launch_behavior = my.get_launch_behavior()
        cell1.add_style('cursor: pointer;')
        cell1.add_behavior(launch_behavior)
        widget.add(table)

        return widget
开发者ID:2gDigitalPost,项目名称:custom,代码行数:28,代码来源:cost_calculator.py

示例11: get_display

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_attr [as 别名]
    def get_display(my):
        name = ''
        if 'code' in my.kwargs.keys():
            code = my.kwargs.get('code') 
        else: 
            sobject = my.get_current_sobject()
            code = sobject.get_code()
            name = sobject.get_value('name')
        if 'name' in my.kwargs.keys():
            name = my.kwargs.get('name')
        search_on_load = 'false'
        if 'search_on_load' in my.kwargs.keys():
            search_on_load = my.kwargs.get('search_on_load')

        widget = DivWdg()
        table = Table()
        table.add_attr('width', '50px')
        table.add_row()
        cell1 = table.add_cell('<img border="0" style="vertical-align: middle" title="" src="/context/icons/custom/imdb.png">')
        cell1.add_attr('code', code)
        cell1.add_attr('name', name)
        cell1.add_attr('search_on_load', search_on_load)
        launch_behavior = my.get_launch_behavior()
        cell1.add_style('cursor: pointer;')
        cell1.add_behavior(launch_behavior)
        widget.add(table)

        return widget
开发者ID:2gDigitalPost,项目名称:custom,代码行数:30,代码来源:order_associator.py

示例12: get_display

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_attr [as 别名]
    def get_display(my):
        sobject = None
        code = ''
        show_checks = False
        if 'source_code' in my.kwargs.keys():
            code = str(my.kwargs.get('source_code'))    
        else:
            sobject = my.get_current_sobject()
            code = sobject.get_code()
        if sobject.get_value('high_security') in [True,'T','t','1']:
            show_checks = True
        widget = DivWdg()
        table = Table()
        table.add_attr('width', '50px')
        if show_checks:
            table.add_style('background-color: #ff0000;')
            login = Environment.get_login()
            user_name = login.get_login()
            table.add_row()
            cell1 =  table.add_cell('<img border="0" style="vertical-align: middle" title="Security Checklist" name="Security Checklist" src="/context/icons/32x32/lock_32_01.png">')
            cell1.add_attr('user', user_name)
            launch_behavior = my.get_launch_behavior(code,user_name)
            cell1.add_style('cursor: pointer;')
            cell1.add_behavior(launch_behavior)
        widget.add(table)

        return widget
开发者ID:2gDigitalPost,项目名称:custom,代码行数:29,代码来源:source_security_wdg.py

示例13: get_display

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_attr [as 别名]
    def get_display(my):   
        from tactic.ui.widget import SObjectCheckinHistoryWdg
        my.sob_code = str(my.kwargs.get('sob_code'))
        my.st = str(my.kwargs.get('st'))
        my.open_type = str(my.kwargs.get('open_type'))
        my.name = str(my.kwargs.get('name'))
        sk = my.server.build_search_key(my.st, my.sob_code)
        obs = InspectScripts()
        edit_wdg = EditWdg(element_name='general', mode=my.open_type, search_type=my.st, code=my.sob_code, title=my.name, view='edit', widget_key='edit_layout')
        table = Table()
        table.add_attr('class','sob_edit_top')
        table.add_row()
        edit_sob_cell = table.add_cell(edit_wdg)
        edit_sob_cell.add_attr('valign','top')
        table.add_row()
        
        history = SObjectCheckinHistoryWdg(search_key=sk)
        history_cell = table.add_cell(history)
        history_cell.add_attr('class','history_sob_cell')
        table.add_row()

        checkin = TwogEasyCheckinWdg2(sk=sk,code=my.sob_code)
        checkin_cell = table.add_cell(checkin)
        checkin_cell.add_attr('class','checkin_sob_cell')
        checkin_cell.add_attr('width','100%s' % '%')
        checkin_cell.add_attr('align','center')

        return table
开发者ID:Smurgledwerf,项目名称:custom,代码行数:30,代码来源:taskobjlauncher.py

示例14: get_display

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_attr [as 别名]
 def get_display(my):   
     from tactic.ui.widget import SObjectCheckinHistoryWdg
     my.code = str(my.kwargs.get('source_code'))
     my.sk = my.server.build_search_key('twog/source',my.code)
     my.movement_code = str(my.kwargs.get('movement_code'))
     ms = MovementScripts(movement_code=my.movement_code)
     clients_expr = "@SOBJECT(twog/client['@ORDER_BY','name desc'])" 
     clients = my.server.eval(clients_expr)
     client_sel = '<select class="REPLACE_ME"><option value="">--Select--</option>'
     for client in clients:
         client_sel = '%s<option value="%s">%s</option>' % (client_sel, client.get('code'), client.get('name'))
     client_sel = '%s</select>' % client_sel
     existing_expr = "@SOBJECT(twog/outside_barcode['source_code','%s'])" % my.code
     existing = my.server.eval(existing_expr)
     count = 0
     table = Table()
     table.add_attr('class','movement_outside_barcodes')
     for obc in existing:
         table.add_row()
         barcode_text_wdg = TextWdg('outside_barcode_insert_%s' % count)
         barcode_text_wdg.set_value(obc.get('barcode'))
         barcode_text_wdg.add_attr('curr_code',obc.get('code'))
         table.add_cell(barcode_text_wdg)
         new_sel = client_sel
         new_sel2 = new_sel.replace('REPLACE_ME','outside_client_%s' % count)
         found = new_sel2.find('"%s"' % obc.get('client_code'))
         if found > 0:
             part1 = new_sel2[:found]
             part2 = new_sel2[found:]
             found2 = part2.find('>')
             if found2 > 0:
                 good2 = part2[found2:]
                 new_sel2 = '%s"%s" selected="selected"%s' % (part1, obc.get('client_code'),good2)
         table.add_cell(new_sel2)
         count = count + 1
     additional_count = [1, 2, 3, 4, 5]
     for n in additional_count:
         table.add_row()
         barcode_text_wdg = TextWdg('outside_barcode_insert_%s' % count)
         barcode_text_wdg.add_attr('curr_code','')
         table.add_cell(barcode_text_wdg)
         new_sel = client_sel
         new_sel = new_sel.replace('REPLACE_ME','outside_client_%s' % count)
         table.add_cell(new_sel)
         count = count + 1
     table.add_row()
     save_tbl = Table()
     save_tbl.add_row()
     s1 = save_tbl.add_cell(' ')
     s1.add_attr('width','100%s' % '%')
     save_cell = table.add_cell('<input type="button" value="Save All"/>')
     save_cell.add_attr('align','center')
     save_cell.add_behavior(ms.get_save_outside_barcodes_behavior(my.code))
     s2 = save_tbl.add_cell(' ')
     s2.add_attr('width','100%s' % '%')
     ss = table.add_cell(save_tbl)
     ss.add_attr('colspan','2')
     ss.add_attr('align','center')
     return table
开发者ID:2gDigitalPost,项目名称:custom,代码行数:61,代码来源:movement_maker.py

示例15: get_display

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_attr [as 别名]
 def get_display(my):   
     widget = DivWdg()
     contents_div = FileBrowserDirectoryContents(dir=my.start_dir,mode=my.mode,custom_top_name=my.custom_top_name)
     table = Table()
     table.add_attr('id','top_of_file_browser_%s' % my.custom_top_name)
     table.add_row()
     con_div = table.add_cell(contents_div)
     con_div.add_attr('id','con_div')
     widget.add(table)
     return widget 
开发者ID:2gDigitalPost,项目名称:custom,代码行数:12,代码来源:file_browser.py


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