class AddForm(base.AddForm): form_fields = form.Fields(IMissionReportStatistics) form_fields['target_facility'].custom_widget = UberSelectionWidget label = _(u"Add Mission Report Statistics") description = _(u"") def create(self, data): return Assignment(**data)
class IMissionReportStatistics(IPortletDataProvider): """ Define your portlet schema here """ target_facility = schema.Choice( title=_(u"Target mission facility"), description=_(u"Find the facility which provides the items to list"), required=True, source=SearchableTextSourceBinder( {'portal_type': ('ploneun.missions.missionfacility')}, default_query='path:')) always_update = schema.Bool( title=_(u'Always update'), description=_( u'If this is checked, the portlet will always be updated ' 'on every page refresh. Else, it\'ll only update when ' 'force_statsportlet_update=True exist in GET parameter'), required=True, default=True)
class EventExtender(grok.Adapter): # This applies to all AT Content Types, change this to # the specific content type interface you want to extend grok.context(IATEvent) grok.name('eval.policy.event_extender') grok.implements(IOrderableSchemaExtender, IBrowserLayerAwareExtender) grok.provides(IOrderableSchemaExtender) layer = IProductSpecific fields = [ # add your extension fields here ExtensionFileField( name='attachment1', widget=ExtensionFileField._properties['widget']( label='File Attachment 1', description=_( "If you have a list of participants, an agenda " "or other supportive documentation click browse and " "select the file to be uploaded."))), ExtensionFileField( name='attachment2', widget=ExtensionFileField._properties['widget']( label='File Attachment 2', description=_( "If you have a list of participants, an agenda " "or other supportive documentation click browse and " "select the file to be uploaded."))), ExtensionFileField( name='attachment3', widget=ExtensionFileField._properties['widget']( label='File Attachment 3', description=_( "If you have a list of participants, an agenda " "or other supportive documentation click browse and " "select the file to be uploaded."))), ExtensionFileField( name='attachment4', widget=ExtensionFileField._properties['widget']( label='File Attachment 4', description=_( "If you have a list of participants, an agenda " "or other supportive documentation click browse and " "select the file to be uploaded."))), ExtensionFileField( name='attachment5', widget=ExtensionFileField._properties['widget']( label='File Attachment 5', description=_( "If you have a list of participants, an agenda " "or other supportive documentation click browse and " "select the file to be uploaded."))), ] def __init__(self, context): self.context = context def getFields(self): return self.fields def getOrder(self, schematas): # you may reorder the fields in the schemata here return schematas
def title(self): return _('Mission Report Statistics')
class EditForm(z3cformhelper.EditForm): form_fields = form.Fields(IMissionReportStatistics) form_fields['target_facility'].custom_widget = UberSelectionWidget label = _(u"Edit Mission Report Statistics") description = _(u"")
from collective.grok import gs from eval.policy import MessageFactory as _ @gs.importstep( name=u'eval.policy', title=_('eval.policy import handler'), description=_('')) def setupVarious(context): if context.readDataFile('eval.policy.marker.txt') is None: return portal = context.getSite() # do anything here
from collective.grok import gs from eval.policy import MessageFactory as _ @gs.importstep(name=u'eval.policy', title=_('eval.policy import handler'), description=_('')) def setupVarious(context): if context.readDataFile('eval.policy.marker.txt') is None: return portal = context.getSite() # do anything here