def _select_field(self): select_field = field.Field( zope.schema.Bool(__name__='select', required=False, title=_(u'select'))) select_field.widgetFactory[INPUT_MODE] = singlecheckboxwidget_factory return select_field
def fields(self): f = field.Field( schema.Bool(__name__='selected', title=unicode(self.context[0]), required=False)) f.widgetFactory[z3c.form.interfaces.INPUT_MODE] = ( singlecheckboxwidget_factory) return field.Fields(f)
def pk_field(self): """ :return: """ row_id_field = field.Field( zs.Int(__name__='id', required=False, title=u'ID')) return row_id_field
def fields(self): fields = field.Fields() for kf in self.key_fields: current = field.Field(kf) if current.__name__ not in fields.keys(): fields += field.Fields(current) if self.subs and not self.unsubscribed_all: self.request.form['form.widgets.' + kf.getName()] = \ self.subs[0].composer_data[kf.getName()] return fields
def fields(self): select_field = field.Field( schema.Bool(__name__=self.channel_selector, title=self.label, default=True, required=False)) select_field.widgetFactory[z3c.form.interfaces.INPUT_MODE] = ( singlecheckboxwidget_factory) fields = field.Fields(select_field, prefix='selector.') if self.context.channel.collector is not None: fields += field.Fields(self.context.channel.collector.schema, prefix='collector.') return fields
class ReportGroup(group.Group): label = _(u"Report") fields = field.Fields( field.Field(Field( __name__="table", title=_(u"Problems"), description=_( u"This table lists the top URLs with a " u"bad status. To retry a URL immediately, select " u"\"Enqueue\". Each entry expands to display the " u"pages that the link appeared on and the location in " u"the HTML markup."), required=False), mode="display", ignoreContext=True), ) fields["table"].widgetFactory = ReportWidget.factory
def fields(self): if self.context.collector is not None: fields = field.Fields(self.context.collector.schema, prefix='collector.') else: fields = field.Fields() comp_fields = field.Fields(self.context.composers[self.format].schema, prefix='composer.') fields += comp_fields.omit( *['composer.' + f.getName() for f in self.parentForm.key_fields]) select_field = field.Field( schema.Bool( __name__=self.channel_selector, title=self.label, default=False, required=False, )) select_field.widgetFactory[z3c.form.interfaces.INPUT_MODE] = ( singlecheckboxwidget_factory) return field.Fields(select_field, prefix='selector.') + fields
from plone.dexterity.utils import createContentInContainer from plone.formwidget.contenttree import ObjPathSourceBinder from plone.app.dexterity.behaviors.metadata import IBasic from plone.app.dexterity.behaviors.exclfromnav import IExcludeFromNavigation from plone.app.layout.navigation.interfaces import INavigationRoot from Acquisition import aq_base from Products.CMFCore.utils import getToolByName from Products.statusmessages.interfaces import IStatusMessage from ..i18n import MessageFactory as _ from ..interfaces import ITranslationGraph language = field.Field(schema.ASCIILine(__name__="language"), mode="hidden") next_url = field.Field(schema.ASCIILine(__name__="next_url"), mode="hidden") interface_name = 'collective.multilingual.interfaces.IMultilingual' class IAdding(Interface): fti = schema.Choice( title=_(u"Content type"), description=_(u"Select the content type to create and use " u"as the language root folder."), required=True, vocabulary="collective.multilingual.vocabularies.ContainerFTIs") schema.ASCIILine()