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

Python tags.input函数代码示例

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

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



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

示例1: render_childDel

 def render_childDel(self, context, xxx_todo_changeme):
     (name, _) = xxx_todo_changeme
     ret = T.form(action="./freeform_post!!deleteChild",
                  enctype="multipart/form-data", method="POST")[
            T.input(type="hidden", name="name", value=name),
            T.input(type="submit", value="Delete")]
     return ret
开发者ID:perkinslr,项目名称:nevow-py3,代码行数:7,代码来源:tree.py


示例2: render_listRow

    def render_listRow(self, ctx: WovenContext, data=None):
        IEventBus("Web").register(self, ISubAccountChangedEvent)
        listCell = inevow.IQ(ctx).patternGenerator("listCell")
        self.expanded = False
        ctx.fillSlots('index', self._subAccount.sub)
        active = T.input(id='active', type='checkbox', checked=self._subAccount.active)
        name = T.input(id='name', value=self.name)
        sub = T.input(id='sub', value=self._subAccount.sub, disabled=True)

        if not self.employee.isAdministrator() or self.parent.selectable:
            active(disabled=True)
            name(disabled=True)
            sub(disabled=True)

        self.preprocess([active, name, sub])
        if self.length == 4:
            r = [listCell(data=dict(listItem='►'))(id='expand-button')[T.Tag("athena:handler")(event='onclick', handler='expand')],
                 listCell(data=dict(listItem='▼'))(style='display:none', id='unexpand-button')[T.Tag("athena:handler")(event='onclick', handler='expand')],
                 ]
        else:
            r = []
        r.extend([listCell(data=dict(listItem=sub))[Tag('athena:handler')(event='ondblclick', handler='expand')],
             listCell(data=dict(listItem=name)),
             listCell(data=dict(listItem=active))])
        return r
开发者ID:UnionGospelMission,项目名称:TimeClock,代码行数:25,代码来源:SubAccountRenderer.py


示例3: rend

    def rend(self, context, data):
        context.remember(data, iformless.IBinding)

        from formless import configurable as conf

        configurable = conf.GroupConfigurable(data.boundTo, data.typedValue.iface)
        context.remember(configurable, iformless.IConfigurable)

        bindingNames = configurable.getBindingNames(context)

        def generateBindings():
            for name in bindingNames:
                bnd = configurable.getBinding(context, name)
                renderer = iformless.IBindingRenderer(bnd, defaultBindingRenderer)
                renderer.isGrouped = True
                renderer.needsSkin = True
                yield tags.invisible(
                    data=bnd,
                    render=renderer,
                    key=name)

        return getError(context), tags.form(
            id=keyToXMLID(context.key),
            enctype="multipart/form-data",
            action=calculatePostURL(context, data),
            method="post",
            **{'accept-charset':'utf-8'})[
                tags.fieldset[
                    tags.legend(_class="freeform-form-label")[data.label],
                    tags.input(type='hidden', name='_charset_'),
                    generateBindings(),
                    tags.input(type="submit")]]
开发者ID:StetHD,项目名称:nevow,代码行数:32,代码来源:webform.py


示例4: render_genericCommand

    def render_genericCommand(self, ctx: WovenContext, data):

        employees = []
        self.l1 = l1 = List(employees, ["Employee ID", "Name"])
        self.l2 = l2 = List([], ["Entry Type", "Work Location", "Sub Account", "Start Time", "End Time", "Shift Duration", "Daily Total", "Approved", "Denied"])
        self.ltl = ltl = ListToListSelector(l1, l2)
        ltl.mappingReturnsNewElements = True
        ltl.prepare(self)
        ltl.visible = True
        ltl.closeable = False
        ltl.getMappingFor = self.getMappingFor
        ltl.setMappingFor = self.setMappingFor
        l2.setSelectable(False)

        startTime = tags.input(id='startTime', placeholder='Start Time')#[tags.Tag('athena:handler')(event='onchange', handler='timeWindowChanged')]
        endTime = tags.input(id='endTime', placeholder='End Time')
        addTime = [
            tags.input(id='addTime', type='button', value='Add Time Entry')[
                tags.Tag('athena:handler')(event='onclick', handler='addTime')],
            tags.select(id='newTimeType')[
                [tags.option(id=et.getTypeName())[et.getTypeName()] for et in self.entryTypes]
                ]
            ]
        if not IAdministrator(self.employee, None):
            addTime = ''

        self.preprocess([startTime, endTime, addTime])
        return [startTime, endTime, tags.br(), addTime, ltl]
开发者ID:UnionGospelMission,项目名称:TimeClock,代码行数:28,代码来源:ApproveShifts.py


示例5: render_pics

    def render_pics(self, ctx, data):
        rows = []
        d = URIRef(ctx.arg('dir'))
        for i, (pic, filename) in enumerate(sorted(picsInDirectory(self.graph, d))[:]):
            img = T.img(src=[localSite(pic), '?size=thumb'],
                        # look these up in the graph
                        width=75, height=56,
                        onclick='javascript:photo.showLarge("%s")' %
                        (localSite(pic) + "?size=large"))


            tableRow = T.table(class_="picRow")[T.tr[
                T.td[T.a(href=localSite(pic))[filename]],
                T.td[img],
                T.td[
                T.div["Depicts: ", T.input(type="text", class_="tags")],
                T.div["Comment: ", T.input(type="text")],
                ],
                ]]

            toCopy = "protoSectionSplitter"
            if i ==0:
                toCopy = "protoSectionBreak"
                

            rows.append([T.raw('<script type="text/javascript">document.write(document.getElementById("%s").innerHTML);</script>' % toCopy),
                         tableRow])
            
        return rows
开发者ID:drewp,项目名称:photo,代码行数:29,代码来源:edit.py


示例6: render

    def render(self, ctx, key, args, errors):

        if errors:
            value = args.get(key,[None])[0]
        else:
            if args is not None:
                value = iforms.IStringConvertible(self.original).fromType(args.get(key))

        def render_node(ctx, data):
            tag = ctx.tag
            data = self.nodeInterface(data)
            tag.fillSlots('value',data.value)
            tag.fillSlots('label',data.label)
            if str(data.value) == str(value):
                tag = tag(checked='checked')
            return tag

        template = T.div()[
            T.input(pattern='item', render=render_node, type='radio', name=key,
                    value=T.slot('value'))[
                T.slot('label')
                ],
            T.input(pattern='itemdisabled', render=render_node,
                    disabled="disabled", type='radio', name=key,
                    value=T.slot('value'))[
                T.slot('label')
                ]
            ]

        return T.invisible(data=self.tree, render=tree.render)[template]
开发者ID:timparkin,项目名称:into-the-light,代码行数:30,代码来源:xforms.py


示例7: render_listRow

    def render_listRow(self, ctx: WovenContext, data=None):
        IEventBus("Web").register(self, IWorkLocationChangedEvent)
        listCell = inevow.IQ(ctx).patternGenerator("listCell")
        self.expanded = False
        ctx.fillSlots('index', self._workLocation.workLocationID)
        active = T.input(id='active', type='checkbox', checked=self._workLocation.active)
        workLocationID = T.input(id='name', value=self._workLocation.workLocationID, disabled=True)
        descr = T.input(id='description', value=self._workLocation.description)

        if not self.employee.isAdministrator() or self.parent.selectable:
            active(disabled=True)
            workLocationID(disabled=True)
            descr(disabled=True)

        self.preprocess([active, workLocationID, descr])
        if self.length==4:
            r = [
                listCell(data=dict(listItem='►'))(id='expand-button')[
                    T.Tag("athena:handler")(event='onclick', handler='expand')],
                listCell(data=dict(listItem='▼'))(style='display:none', id='unexpand-button')[
                    T.Tag("athena:handler")(event='onclick', handler='expand')],
            ]
        else:
            r = []
        r.extend([listCell(data=dict(listItem=workLocationID))[T.Tag('athena:handler')(event='ondblclick', handler='expand')],
                  listCell(data=dict(listItem=descr)),
                  listCell(data=dict(listItem=active))])
        return r
开发者ID:UnionGospelMission,项目名称:TimeClock,代码行数:28,代码来源:WorkLocationRenderer.py


示例8: _renderTag

    def _renderTag(self, ctx, tparser, tvalue, namer, readonly):
        tag=T.invisible()
        if len(self.parsers) > 1:
            tp = T.select(name=namer('tparser'),id=render_cssid(namer('tparser')))
            if readonly:
                tp(class_='disabled', disabled='disabled')        
            
            for k,v in self.parsers:
                if k == tparser:
                    tp[T.option(selected='selected',value=k)[ v ]]
                else:
                    tp[T.option(value=k)[ v ]]
        else:
            tp = T.input(type='hidden',name=namer('tparser'),id=render_cssid(namer('tparser')),value=self.parsers[0][0])
        tag[tp]     
               
        if self.itemTypes is not None:
            tag[ T.input(type='hidden',class_="itemTypes",name=namer('itemTypes'),id=render_cssid(namer('itemTypes')),value=encodeTypes(self.itemTypes)) ]
        if self.itemTemplates is not None:
            tag[ T.input(type='hidden',class_="itemTemplates",name=namer('itemTemplates'),id=render_cssid(namer('itemTemplates')),value=','.join(self.itemTemplates)) ]

        ta=T.textarea(name=namer('tvalue'), id=render_cssid(namer('tvalue')), cols=self.cols, rows=self.rows)[tvalue or '']
        if readonly:
            ta(class_='readonly', readonly='readonly')
        tag[ [T.br,ta ]]
        return tag
开发者ID:timparkin,项目名称:into-the-light,代码行数:26,代码来源:richtextarea.py


示例9: render_booleanOption

 def render_booleanOption(self, ctx, boolean):
     if boolean.getValue():
         checked = "checked"
     else:
         checked = None
     return (
         T.input(type="checkbox", name=boolean.getName(), checked=checked),
         T.input(type="hidden", name=boolean.getName(), value="off"))
开发者ID:braams,项目名称:shtoom,代码行数:8,代码来源:prefs.py


示例10: _renderTag

 def _renderTag(self, ctx, year, month, namer, readonly):
     yearTag = T.input(type="text", name=namer('year'), value=year, size=2)
     monthTag = T.input(type="text", name=namer('month'), value=month, size=2)
     if readonly:
         tags=(yearTag, monthTag)
         for tag in tags:
             tag(class_='readonly', readonly='readonly')
     return monthTag, ' / ', yearTag, ' (mm/yy)'
开发者ID:nakedible,项目名称:vpnease-l2tp,代码行数:8,代码来源:widget.py


示例11: renderImmutable

 def renderImmutable(self, ctx, key, args, errors):
     values = ('', '')
     return [
         T.input(type='password', name=key, id=render_cssid(key), value=values[0], class_='readonly', readonly='readonly'),
         T.br,
         T.label(for_=render_cssid(key, 'confirm'))[' Confirm '],
         T.input(type='password', name=key, id=render_cssid(key, 'confirm'),
                 value=values[1], class_='readonly', readonly='readonly')
     ]
开发者ID:nakedible,项目名称:vpnease-l2tp,代码行数:9,代码来源:widget.py


示例12: bool_widget

    def bool_widget(self, name, data):
        info = dict(name=name,
                    choices=[(True, 'True'), (False, 'False')],
                    selected=data)

        if data:
            return T.input(name=name, _type='checkbox', checked='checked')
        else:
            return T.input(name=name, _type='checkbox')
开发者ID:cryptixman,项目名称:tzmud,代码行数:9,代码来源:pages_edit.py


示例13: _renderTag

    def _renderTag(self, ctx, height, width, depth, namer, readonly):
        heightTag = T.input(type="text", name=namer('height'), value=height, size=8)
        widthTag = T.input(type="text", name=namer('width'), value=width, size=8)
        depthTag = T.input(type="text", name=namer('depth'), value=depth, size=8)
        if readonly:
            tags = (heightTag, widthTag, depthTag)
            for tag in tags:
                tag(class_='readonly', readonly='readonly')

        return heightTag, 'h ', widthTag, 'w ', depthTag, 'd '
开发者ID:timparkin,项目名称:into-the-light,代码行数:10,代码来源:widgets.py


示例14: rend

 def rend(self, patterns, item, attribute):
     cell = patterns.patternGenerator(self.pattern)()
     id = item.getAttributeValue(attribute)
     tag = T.input(type="checkbox", name='%s-%s'%(self.name, id), value=id)
     value = item.getAttributeValue(self.name)
     if value:
         tag = tag(checked='checked')
     tag[ T.input(type='hidden', name='%s-%s-val'%(self.name, id), value=value) ]
     cell.fillSlots('value', tag)
     return cell
开发者ID:timparkin,项目名称:into-the-light,代码行数:10,代码来源:web.py


示例15: title

 def title(self, ctx, data):
     title = data.get('ptitle')
     if title == '':
         title = data.get('ttitle')
     title = clean(title)
     hd_inpt = t.input(type="hidden", id="reply_to",
                       name="reply_to", value=data.get('pid'))
     inpt = t.input(type="text", id="title_", name="title",
                    maxlength="70", size="60", value=title)
     return t.invisible[hd_inpt, inpt]
开发者ID:BackupTheBerlios,项目名称:weever-svn,代码行数:10,代码来源:topic.py


示例16: render_mkdir_form

 def render_mkdir_form(self, ctx, data):
     # this is a form where users can create new directories
     form = T.form(action="uri", method="post",
                   enctype="multipart/form-data")[
         T.fieldset[
         T.legend(class_="freeform-form-label")["Create a directory"],
         T.input(type="hidden", name="t", value="mkdir"),
         T.input(type="hidden", name="redirect_to_result", value="true"),
         T.input(type="submit", value="Create a directory"),
         ]]
     return T.div[form]
开发者ID:drewp,项目名称:tahoe-lafs,代码行数:11,代码来源:root.py


示例17: render

 def render(self, ctx, key, args, errors):
     if errors and not errors.getFieldError(key):
         values = args.get(key)
     else:
         values = ('', '')
     return [
         T.input(type='password', name=key, id=render_cssid(key), value=values[0]),
         T.br,
         T.label(for_=render_cssid(key, 'confirm'))[' Confirm '],
         T.input(type='password', name=key, id=render_cssid(key, 'confirm'), value=values[1]),
         ]
开发者ID:nakedible,项目名称:vpnease-l2tp,代码行数:11,代码来源:widget.py


示例18: render_deep_stats_form

 def render_deep_stats_form(self, ctx, data):
     ophandle = base32.b2a(os.urandom(16))
     deep_stats = T.form(action=".", method="post",
                         enctype="multipart/form-data")[
         T.fieldset[
         T.input(type="hidden", name="t", value="start-deep-stats"),
         T.legend(class_="freeform-form-label")["Run a deep-stats operation (EXPENSIVE)"],
         T.input(type="hidden", name="ophandle", value=ophandle),
         T.input(type="submit", value="Deep-Stats"),
         ]]
     return ctx.tag[deep_stats]
开发者ID:ArtRichards,项目名称:tahoe-lafs,代码行数:11,代码来源:info.py


示例19: render_incident_button

 def render_incident_button(self, ctx, data):
     # this button triggers a foolscap-logging "incident"
     form = T.form(action="report_incident", method="post",
                   enctype="multipart/form-data")[
         T.fieldset[
         T.input(type="hidden", name="t", value="report-incident"),
         "What went wrong?"+SPACE,
         T.input(type="text", name="details"), SPACE,
         T.input(type="submit", value=u"Save \u00BB"),
         ]]
     return T.div[form]
开发者ID:warner,项目名称:tahoe-lafs,代码行数:11,代码来源:root.py


示例20: render_incident_button

 def render_incident_button(self, ctx, data):
     # this button triggers a foolscap-logging "incident"
     form = T.form(action="report_incident", method="post",
                   enctype="multipart/form-data")[
         T.fieldset[
         T.legend(class_="freeform-form-label")["Report an Incident"],
         T.input(type="hidden", name="t", value="report-incident"),
         "What went wrong?: ",
         T.input(type="text", name="details"), " ",
         T.input(type="submit", value="Report!"),
         ]]
     return T.div[form]
开发者ID:drewp,项目名称:tahoe-lafs,代码行数:12,代码来源:root.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python tags.invisible函数代码示例发布时间:2022-05-27
下一篇:
Python tags.img函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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