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")]]
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")]]
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) )
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))
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))