class IBluechurchevent(model.Schema): """ Marker interface for Bluechurchevent """ directives.order_after(city='IEventLocation.location') city = schema.TextLine(title=_(u'label_city', default=u'City'), description=_(u'help_city', default=u''), required=True) directives.order_after(country='city') country = schema.Choice(title=_(u'label_country', default=u'Country'), description=_( u'help_country', default=u'Select the country from the list.'), required=True, vocabulary='collective.address.CountryVocabulary') widget(eventformen='z3c.form.browser.checkbox.CheckBoxFieldWidget') eventformen = schema.Set( title=_(u'Event Type'), value_type=schema.Choice(vocabulary='rohberg.bluechurch.Eventformen'), required=False, ) model.load('bluechurchevent.xml')
class IRelatedContacts(model.Schema): form.order_before(location='IRichText.text') location = ContactChoice( title=_(u'Location'), source=ContactSourceBinder(portal_type=('organization', ), ), required=False, ) form.order_after(organizer='IRelatedContacts.location') organizer = ContactChoice( title=_(u'Organizer'), source=ContactSourceBinder(portal_type=('person', 'organization'), ), required=False, ) form.order_after(contact='IRelatedContacts.organizer') contact = ContactChoice( title=_(u'Contact'), source=ContactSourceBinder(portal_type=('person', 'organization'), ), required=False, ) form.order_after(partners='IRelatedContacts.contact') partners = ContactList( title=_(u'Partners'), value_type=ContactChoice(title=_(u'Partner'), source=ContactSourceBinder( portal_type=('person', 'organization'), )), required=False, )
class IExpert(model.Schema): """ """ dexteritytextindexer.searchable('competence') # dexteritytextindexer.searchable('region') # extra index for filtering by region dexteritytextindexer.searchable('organisation') competence = schema.TextLine( title=_(u'Competence'), required=False, ) region = schema.TextLine( title=_(u'Region'), required=False ) organisation = schema.TextLine( title=_(u'Organisation'), required=False, ) widget(is_expert=RadioFieldWidget) is_expert = schema.Bool( title=_(u'Ist Experte. In Expertensuche aufnehmen.'), default=True, required=False, ) order_after(is_expert='last_name') order_after(organisation='last_name') order_after(region='last_name') order_after(competence='last_name')
class IRERNews(model.Schema): directives.order_after(image='IRichText.text') image = RelationChoice( title=_(u'Image'), required=False, vocabulary='plone.app.vocabularies.Catalog', ) directives.widget( 'image', RelatedItemsFieldWidget, source=CatalogSource(portal_type=('Image')), pattern_options={'resultTemplate': RESULT_TEMPLATE}, ) directives.order_after(image_caption='image') image_caption = schema.TextLine( title=_(u'label_image_caption', default=u'Image Caption'), description=u'', required=False, ) directives.order_after(related_links='image_caption') related_links = RelationList( title=_(u'Related links'), default=[], value_type=RelationChoice( title=u'Related', vocabulary='plone.app.vocabularies.Catalog', ), required=False) directives.widget('related_links', RelatedItemsFieldWidget, source=CatalogSource(portal_type=('Link')))
class ISector(model.Schema, IUser, IBasic): """Sector object. A sector is a national organisation for a specific type of industry. """ directives.order_before(title="*") directives.write_permission(title="euphorie.content.ManageCountry") directives.order_after(login="******") directives.write_permission(login="******") directives.order_before(password="******") directives.order_after(locked="password") directives.write_permission(locked="euphorie.content.ManageCountry") contact_name = schema.TextLine( title=_("label_contact_name", default="Contact name"), required=True ) directives.order_after(contact_email="contact_name") logo = filefield.NamedBlobImage( title=_("label_logo", default="Logo"), description=_( "help_image_upload", default="Upload an image. Make sure your image is of format " "png, jpg or gif and does not contain any special " "characters. The minimum size is 1000 (width) x 430 (height) pixels.", ), required=False, )
class IArgomentiDocumento(IArgomentiSchema): """ """ model.fieldset( "correlati", label=_("correlati_label", default="Contenuti collegati"), fields=["correlato_in_evidenza"], ) form.order_after(correlato_in_evidenza="IRelatedItems.relatedItems") form.order_after(tassonomia_argomenti="IDublinCore.title")
class IOfficeInfo(model.Schema): """Behavior schema """ order_after(room='IContactInfo.phone_number') room = schema.TextLine( title=_(u'Room'), # description=_(u'Room Info'), required=False) order_after(short_number='IContactInfo.phone_number') widget(short_number=ShortNumberFieldWidget) short_number = schema.Int(title=_(u'Short number'), required=False, constraint=is_short_number)
class IArgomentiDocument(IArgomentiSchema): """ """ model.fieldset( "correlati", label=_("correlati_label", default="Contenuti collegati"), fields=["correlato_in_evidenza"], ) model.fieldset( "testata", label=_("testata_fieldset_label", default="Testata"), fields=["tassonomia_argomenti"], ) form.order_after(correlato_in_evidenza="IRelatedItems.relatedItems") form.order_after(tassonomia_argomenti="IInfoTestata.mostra_navigazione")
class IDossierTemplateSchema(model.Schema): """Schema interface for dossier template types. Use this type of dossier to create a reusable template structures. """ model.fieldset( u'common', label=base_mf(u'fieldset_common', default=u'Common'), fields=[ u'title_help', u'predefined_keywords', u'restrict_keywords', ], ) title_help = schema.TextLine( title=_(u'label_title_help', default=u'Title help'), description=_(u'help_title_help', default=u'Recommendation for the title. Will be ' u'displayed as a help text if you create ' u'a dossier from template'), required=False, ) form.order_after(predefined_keywords='IDossierTemplate.keywords') predefined_keywords = schema.Bool( title=_(u'label_predefined_keywords', default=u'Predefined Keywords'), description=_(u'description_predefined_keywords', default=u'The defined keywords will be preselected for ' u'new dossies from template.'), required=False, missing_value=True, default=True, ) form.order_after(restrict_keywords='predefined_keywords') restrict_keywords = schema.Bool( title=_(u'label_restrict_keywords', default=u'Restrict Keywords'), description=_( u'description_restrict_keywords', default=u'The user can choose only from the defined keywords ' u'in a new dossier from template. It also prevents ' u'the user for creating new keywords'), required=False, missing_value=False, default=False, )
class IVersionable(model.Schema): """ Behavior for enabling CMFEditions's versioning for dexterity content types. Be shure to enable versioning in the plone types control-panel for your content type. """ model.fieldset('settings', label=_(u'Settings'), fields=['versioning_enabled']) changeNote = schema.TextLine( title=_(u'label_change_note', default=u'Change Note'), description=_( u'help_change_note', default=u'Enter a comment that describes the changes you made. ' u'If versioning is manual, you must set a change note ' u'to create the new version.'), required=False) versioning_enabled = schema.Bool( title=_(u'label_versioning_enabled', default=u'Versioning enabled'), description=_(u'help_versioning_enabled', default=u'Enable/disable versioning for this document.'), default=True, required=False) form.order_after(changeNote='*') form.omitted('changeNote') form.no_omit(IEditForm, 'changeNote') form.no_omit(IAddForm, 'changeNote')
class ITenure(model.Schema): """ Marker interfce and Dexterity Python Schema for Tenure """ directives.order_after(evaluation_date='IPersonalData.current_position') evaluation_date = schema.Date( title=_(u'Evaluation deadline'), required=True, ) @invariant def validate_dates(data): try: really_creation_date = data.__context__.creation_date creation_date = datetime.datetime(really_creation_date.year(), really_creation_date.month(), really_creation_date.day(), really_creation_date.hour(), really_creation_date.minute()) except Exception: creation_date = datetime.datetime.today() if (data.evaluation_date < creation_date.date()): raise Invalid( _('label_error_dates', default= u'The Evaluation deadline must be grather than Creation Date' ))
class IDocumentSchema(model.Schema): """Document Schema Interface.""" model.fieldset( u'common', label=_(u'fieldset_common', u'Common'), fields=[ u'title', u'file', ], ) dexteritytextindexer.searchable('title') form.order_before(title='IDocumentMetadata.description') title = schema.TextLine(title=_(u'label_title', default=u'Title'), required=False) model.primary('file') form.order_after(file='IDocumentMetadata.document_author') file = field.NamedBlobFile( title=_(u'label_file', default='File'), description=_(u'help_file', default=''), required=False, ) @invariant def title_or_file_required(data): if not data.title and not data.file: raise Invalid( _(u'error_title_or_file_required', default=u'Either the title or the file is ' 'required.'))
class INoticeSchema(model.Schema): """A Folderish type for notices, which may hold images""" price = schema.TextLine( title=_(u'label_price', default=u'Price'), required=True, ) email = schema.TextLine( title=_(u'label_email', default=u'E-Mail'), required=True, ) text = RichText(title=_(u'label_text', default=u'Text'), required=True, allowed_mime_types=('text/html', )) directives.order_after(accept_conditions='*') accept_conditions = schema.Bool( title=_(u'label_accept_conditions', default=u'Terms and Conditions'), description=_( u'description_accept_conditions', default=u'Please accept the ' '<a target="_blank" href="./terms-and-conditions">terms and conditions</a>' ), default=False)
class ISchedule(Interface): form.order_after(schedule='IEventRecurrence.recurrence') schedule = schema.Text( title=u'Schedule', required=False, )
class IRelatedDocuments(model.Schema): """The 'Related documents' behvavior is an opengever.document specific 'Related items' behavior. Only allows references to opengever.documents. """ form.order_after(relatedItems='IDocumentMetadata.preserved_as_paper') relatedItems = RelationList( title=_(u'label_related_documents', default=u'Related Documents'), default=[], missing_value=[], value_type=RelationChoice( title=u"Related", source=RepositoryPathSourceBinder( portal_type=("opengever.document.document", "ftw.mail.mail"), navigation_tree_query={ 'object_provides': ['opengever.repository.repositoryroot.IRepositoryRoot', 'opengever.repository.repositoryfolder.' + 'IRepositoryFolderSchema', 'opengever.dossier.behaviors.dossier.IDossierMarker', 'opengever.document.document.IDocumentSchema', 'ftw.mail.mail.IMail', ] }), ), required=False, ) model.fieldset( u'common', label=_(u'fieldset_common', default=u'Common'), fields=[ u'relatedItems', ], )
class IVenue(model.Schema): """Marker schema interface for Venue types.""" notes = RichText( title=_(u'label_notes', default=u'Notes'), description=_(u'help_notes', default=u'Additional notes for the address.'), required=False, ) order_after(notes='*')
class IArgomenti(IArgomentiSchema): """ """ model.fieldset( "correlati", label=_("correlati_label", default="Contenuti collegati"), fields=["correlato_in_evidenza"], ) form.order_after(correlato_in_evidenza="IRelatedItems.relatedItems")
class ITileInterface(ISkeeterTile): form.order_after(target='title') form.omitted('featured_id') target = schema.Choice( title=_(u"Target Collection"), source=CatalogSource(object_provides=ICollection.__identifier__), required=False, )
class ISocialContact(ISocialMediaBase, IContact): form.order_after(email='zip_code') form.order_after(facebook_url='fax_number') form.order_after(twitter_url='facebook_url') form.order_after(youtube_url='twitter_url') form.order_after(instagram_url='youtube_url') form.order_after(linkedin_url='instagram_url') form.order_after(newsletter_url='linkedin_url')
class ICollectionFieldCollapser(model.Schema): """Model based Dexterity Type""" collapse_on = schema.Choice( title=_(u"Collapse on"), source=collapse_on_vocab, required=False, description=_( u"Select the field, which the results will collapse on and return " u"the first of each collapsed set")) directives.order_after(collapse_on='ICollection.query')
class IImageRights(model.Schema): """ """ directives.order_after(image_rights='image') image_rights = schema.TextLine( title=_(u'Image Rights'), description=_( u'Copyright statement or other rights information on this item.'), required=False, )
class IBooking(model.Schema): directives.order_after(booking_type='IDublinCore.description') booking_type = schema.Choice( title=_(u'Booking type'), required=False, vocabulary=u'cpskin.core.vocabularies.booking_types', ) directives.order_after(booking_price='.booking_type') booking_price = schema.Text( title=_(u'Price'), required=False, ) directives.order_after(booking_url='.booking_price') booking_url = schema.URI( title=_(u'Booking URL'), required=False, )
class IDummy(model.Schema): form.omitted('foo') form.omitted('bar') form.widget(foo='some.dummy.Widget') form.widget(baz='other.Widget') form.mode(bar='hidden') form.mode(foo='display') form.order_before(baz='title') form.order_after(baz='qux') form.order_after(qux='bar') form.order_before(foo='body') form.read_permission(foo='zope2.View', bar='zope2.View') form.read_permission(baz='random.Permission') form.write_permission(foo='cmf.ModifyPortalContent') form.write_permission(baz='another.Permission') foo = zope.schema.TextLine(title=u'Foo') bar = zope.schema.TextLine(title=u'Bar') baz = zope.schema.TextLine(title=u'Baz') qux = zope.schema.TextLine(title=u'Qux')
class IRichDescription(model.Schema): """Simple behaviour for content types with a HTML description. Replaces the standard description field with a rich text version. """ description = schema.Text( title=_("Summary"), description=_("A short summary of the content."), required=False, ) directives.widget(description=WysiwygFieldWidget) directives.order_after(description="title")
class IBandoSchema(model.Schema): """ A Dexterity schema for Annoucements """ form.order_after(riferimenti_bando='IRichText.text') riferimenti_bando = RichText( title=_('riferimenti_bando_label', default=u"References"), description=_('riferimenti_bando_help', default=u""), required=False ) form.order_after(chiusura_procedimento_bando='IRichText.text') chiusura_procedimento_bando = schema.Date( title=_( 'chiusura_procedimento_bando_label', default=u"Closing date procedure" ), description=_('chiusura_procedimento_bando_help', default=u''), required=False ) form.order_after(scadenza_bando='IRichText.text') scadenza_bando = schema.Datetime( title=_('scadenza_bando_label', default=u"Expiration date and time"), description=_( 'scadenza_bando_help', default=u"Deadline to participate in the announcement" ), required=False ) form.order_after(ente_bando='IRichText.text') directives.widget('ente_bando', AjaxSelectFieldWidget, vocabulary='rer.bandi.enti.vocabulary') ente_bando = schema.Tuple( title=_(u'ente_label', default=u'Authority'), description=_(u'ente_help', default=u'Select some authorities.'), required=False, defaultFactory=getDefaultEnte, value_type=schema.TextLine(), missing_value=None ) form.order_after(destinatari='IRichText.text') directives.widget(destinatari=CheckBoxFieldWidget) destinatari = schema.List( title=_('destinatari_label', default=u"Recipients"), description=_('destinatari_help', default=''), required=True, value_type=schema.Choice(vocabulary='rer.bandi.destinatari.vocabulary') ) form.order_after(tipologia_bando='IRichText.text') directives.widget(tipologia_bando=RadioFieldWidget) tipologia_bando = schema.Choice( title=_('tipologia_bando_label', default=u"Announcement type"), description=_('tipologia_bando_help', default=''), vocabulary='rer.bandi.tipologia.vocabulary', required=True )
class ITaskTemplateFolderSchema(model.Schema): """Marker Schema for TaskTemplateFolder""" model.fieldset(u'common', label=_(u'fieldset_common', default=u'Common'), fields=[u'sequence_type']) directives.order_after(sequence_type='IOpenGeverBase.description') sequence_type = schema.Choice( title=_(u'label_sequence_type', default='Type'), vocabulary=sequence_type_vocabulary, required=True, )
class IExcludeFromSearch(model.Schema): """\ Allows the implementing objects to be excluded from standard search operations """ order_after( excludeFromSearch='IExcludeFromNavigation.excludeFromNavigation') # in Products.unitracc.content.unitraccanimation: readable/writable with 'Manage portal' excludeFromSearch = schema.Bool( title=_(u'Exclude from search'), required=True, default=False, description= _(u'If selected, the object won\'t be found in standard catalog searches' ))
class ICollectionFieldCollapser(model.Schema): """Model based Dexterity Type""" directives.widget('collapse_on', SelectFieldWidget) directives.order_after(collapse_on='ICollection.query') collapse_on = schema.Set( title=_(u"Collapse on"), required=False, value_type=schema.Choice(source=collapse_on_vocab), description=_( u"Select the field, which the results will collapse on and return " u"the first of each collapsed set")) directives.widget('merge_fields', SelectFieldWidget) directives.order_after( merge_fields='ICollectionFieldCollapser.collapse_on') merge_fields = schema.Set( title=_(u"Fields to merge"), required=False, description= _(u"Combine field data into a list/text when items collapse based on associated Index type. This is useful for" u"collective.collectionfilter to ensure the right options appear in filters" ), value_type=schema.Choice(source=collapse_on_vocab, )) directives.order_after( max_unfiltered_page_size='ICollectionFieldCollapser.merge_fields') max_unfiltered_page_size = schema.Int( title=_(u"Max Uncollapsed Page Size"), required=False, default=1000, description= _(u"To improve performance the search will only lookahead this number " u"of results which will then be collapsed into one page in a batch. " u"If this is set to low you may be missing results on the current page." ))
class IPage(model.Schema, IRichDescription, IBasic): """A basic page.""" description = HtmlText( title=_("label_module_description", "Description"), description=_( "help_module_description", default="Include any relevant information that may be " "helpful for the end-user.", ), required=True, ) directives.widget(description=WysiwygFieldWidget) directives.order_after(description="title") body = HtmlText(title=_("label_body", "Page content"), required=True) directives.widget(body=WysiwygFieldWidget)
class IDummy(model.Schema): form.omitted('foo', 'bar') form.omitted(model.Schema, 'qux') form.no_omit(model.Schema, 'bar') form.widget(foo='some.dummy.Widget', baz='other.Widget') form.mode(bar='hidden') form.mode(model.Schema, bar='input') form.order_before(baz='title') form.order_after(qux='title') form.read_permission(foo='zope2.View') form.write_permission(foo='cmf.ModifyPortalContent') foo = zope.schema.TextLine(title=u'Foo') bar = zope.schema.TextLine(title=u'Bar') baz = zope.schema.TextLine(title=u'Baz') qux = zope.schema.TextLine(title=u'Qux')