コード例 #1
0
ファイル: webform.py プロジェクト: StetHD/nevow
    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")]]
コード例 #2
0
    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 invisible(data=bnd, render=renderer, key=name)

        return getError(context), form(
            id=keyToXMLID(context.key),
            enctype="multipart/form-data",
            action=calculatePostURL(context, data),
            method="post",
            **{'accept-charset': 'utf-8'
               })[fieldset[legend(_class="freeform-form-label")[data.label],
                           input(type='hidden', name='_charset_'),
                           generateBindings(),
                           input(type="submit")]]
コード例 #3
0
ファイル: webform.py プロジェクト: StetHD/nevow
 def fillForm(self, context, data):
     context.fillSlots( 'form-id', keyToXMLID(context.key) )
     context.fillSlots( 'form-action', calculatePostURL(context, data) )
     context.fillSlots( 'form-name', data.name )
     context.fillSlots( 'form-error', getError(context) )
コード例 #4
0
 def fillForm(self, context, data):
     context.fillSlots('form-id', keyToXMLID(context.key))
     context.fillSlots('form-action', calculatePostURL(context, data))
     context.fillSlots('form-name', data.name)
     context.fillSlots('form-error', getError(context))
コード例 #5
0
ファイル: webform.py プロジェクト: perkinslr/nevow-py3
 def fillForm(self, context, data):
     context.fillSlots("form-id", keyToXMLID(context.key))
     context.fillSlots("form-action", calculatePostURL(context, data))
     context.fillSlots("form-name", data.name)
     context.fillSlots("form-error", getError(context))