searchable=True, storage=atapi.AnnotationStorage(), widget=atapi.LinesWidget(label=_(u"Course code"), visible=False)), atapi.StringField( 'registered', #required=True, storage=atapi.AnnotationStorage(), widget=atapi.StringWidget(label=_(u"Course code"), visible=False)), atapi.IntegerField( "vigencyDays", required=False, default=365, storage=atapi.AnnotationStorage(), widget=atapi.IntegerWidget( label=_(u'Course expiration period'), description=_( u'Defines the number of days the course stays open.'), ), ), )) CourseSchema['title'].storage = atapi.AnnotationStorage() CourseSchema['description'].storage = atapi.AnnotationStorage() finalizeATCTSchema(CourseSchema, folderish=True, moveDiscussion=False) hideMetadataSchema(CourseSchema, excludeFromNav=True) class Course(folder.ATBTreeFolder): """An ATBTreeFolder that contains course-related items. """
BookSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- atapi.StringField( 'author', widget=atapi.StringWidget( label=_(u"Author"), description=_(u"Author of this book"), ), required=True, ), atapi.IntegerField( 'stars', widget=atapi.IntegerWidget( label=_(u"Stars"), description=_( u"How well do you like this book? Use number 1 through 5."), ), validators=('isInt'), schemata='starschema', ), )) schemata.finalizeATCTSchema(BookSchema, moveDiscussion=False) class Book(base.ATCTContent): """Information about a book""" implements(IBook) meta_type = "Book"
label=_(u"Giorni festivi"), description=_( 'help_holidays', u"Indicare i giorni festivi (uno per riga) " u"nel formato GG/MM/AAAA. Al posto dell'anno puoi mettere un " u"asterisco per indicare un evento che ricorre annualmente."), ), required=False, ), atapi.IntegerField( 'futureDays', required=True, default=0, widget=atapi.IntegerWidget( label=_(u'Max days in the future'), description=_('futureDays', default=u"Limit booking in the future to an amount " u"of days in the future starting from " u"the current day. \n" u"Keep 0 to give no limits."), ), ), DataGridField( 'tipologia', storage=atapi.AnnotationStorage(), columns=('name', 'duration'), allow_delete=True, allow_insert=True, allow_reorder=False, widget=DataGridWidget( label=_(u"Tipologie di richiesta"), description=_('tipologia_help', default=u"Put booking types there (one per line).\n"
from iservices.rssdocument import RSSDocumentMessageFactory as _ from iservices.rssdocument.interfaces import IRSSDocument from iservices.rssdocument import config RSSDocumentSchema = ATContentTypeSchema.copy() + atapi.Schema(( atapi.StringField( 'RSSLink', required=True, widget=atapi.StringWidget(label=_(u'RSS URL'), description=_(u'The URL of the RSS Feed')), ), atapi.IntegerField( 'max_entries', required=True, widget=atapi.IntegerWidget( label=_(u'Max Entries'), description=_(u'Maximum Number of entries to show')), ), )) finalizeATCTSchema(RSSDocumentSchema) class RSSDocument(base.ATCTContent): """A Plone document that embedds a RSS feed with JQuery""" implements(IRSSDocument) schema = RSSDocumentSchema security = ClassSecurityInfo() security.declareProtected(ModifyPortalContent, 'setRSSLink')
default=u'Criteria of inserting new row.\n' u'Choose if add row at the end of group (append) ' u'or before group (prepend).'), ), ), atapi.IntegerField('batchSize', searchable=False, schemata="settings", default=100, required=True, widget=atapi.IntegerWidget( label=_(u'Max number of rows'), description=_('help_batchSize', default=u'Insert the maximum number of rows to be displayed ' u'in a single page.\n' u'When this limit is reached a batching navigation section ' u'will be displayed.\n' u'Use 0 to disable batching (NOT suggested on very large tables or ' u'extremly complex column types).'), ), ), # FOO FIELD!!!! Only needed to being able to use the ATReferenceBrowserWidget... :( atapi.StringField('link_internal', widget=ReferenceBrowserWidget( label=u"Internal link dump field", visible={'view': 'invisible', 'edit': 'invisible'}, force_close_on_insert=True, startup_directory_method="this_directory", ), ),
# -*- Message Factory Imported Here -*- from leam.luc import lucMessageFactory as _ from leam.luc.interfaces import IProbmap from leam.luc.config import PROJECTNAME ProbmapSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- atapi.IntegerField( 'year', storage=atapi.AnnotationStorage(), widget=atapi.IntegerWidget( label=_(u"Effective Year"), description=_(u"Each driver given below should correspond to this year."), ), required=True, default=_(u"2010"), validators=('isInt'), ), atapi.ReferenceField( 'tdm', storage=atapi.AnnotationStorage(), widget=ReferenceBrowserWidget( allow_browse=1, allow_search=1, startup_directory='/luc/drivers/transportation', label=_(u"TDM Transportation Network"),
il8n_domain='ISAW_Event', ), required=False, searchable=True), # After about 10 minutes deliberation # instead of making this an Annotation i've added it to the object itself # the reason being is all data should be stored/managed in the object if it's small enough atapi.IntegerField( name='event_BlogId', widget=atapi.IntegerWidget( label=u'Event Blog id', label_msgid='ISAW_Event_blogid', il8n_domain='ISAW_Event', size=10, visible={'view': 'visible', 'edit': 'hidden'}, ), # Does isMetadata work anymore? isMetadata=True, required=False), atapi.BooleanField( schemata='options', name='event_Twitter', widget=atapi.BooleanWidget( description=_(u'event_twitter', default=u'If selected, this event will appear on Twitter @ http://twitter.com/isawnyu'), label=u'Post this event on Twitter?',
u'Check this box if you want the questions ' u'in this container to appear in a different, random ' u'order for each candidate. Otherwise the same order ' u'as in the "contents"-view will be used.'), ), ), atapi.IntegerField( "numberOfRandomQuestions", required=False, default=-1, storage=atapi.AnnotationStorage(), widget=atapi.IntegerWidget( label=_(u'Number of Random Questions'), description=_(u'The number of questions which are randomly ' u'selected when a new quiz is ' u'generated for a student. (This only works if ' u'"Randomize Question Order" ' u'is checked.) A value <= 0 means that all ' u'questions will be used.'), ), ), atapi.BooleanField('BadResults', default=True, accessor='viewBadResults', storage=atapi.AnnotationStorage(), widget=atapi.BooleanWidget( label=_(u'Show incorrect answers'), )), )) ########################################################### # Exam Schema
'MINI', 'MITSUBISHI', 'MIURA', 'NISSAN', 'PEUGEOT', 'PLYMOUTH', 'PONTIAC', 'PORSCHE', 'RAM', 'RELY', 'RENAULT', 'ROLLS-ROYCE', 'ROVER', 'SAAB', 'SATURN', 'SEAT', 'SHINERAY', 'SMART', 'SSANGYONG', 'SUBARU', 'SUZUKI', 'TAC', 'TOYOTA', 'TROLLER', 'VOLVO', 'VW - VOLKSWAGEN', 'WAKE', 'WALK' ], widget=atapi.SelectionWidget( label=_(u'label_marca', u'Marca'), format='select', ), ), atapi.IntegerField( name="ano", validators=('isInt', ), searchable=True, widget=atapi.IntegerWidget(label=_(u'label_ano', u'Ano'), ), ), atapi.IntegerField( name="modelo", validators=('isInt', ), searchable=True, widget=atapi.IntegerWidget(label=_(u'label_modelo', u'Modelo'), ), ), atapi.StringField(name="cor", required=True, searchable=True, widget=atapi.StringWidget(label=_(u'label_cor', u'Cor'), )), atapi.StringField(name="valor", required=True, searchable=True,
'los_categories', multiValued=True, allowed_types=('LOSCategory', ), relationship='sd_los', vocabulary='losCategoriesVocab', widget=atapi.ReferenceWidget(label=_(u"LOS categories"), ), languageIndependent=True, required=False, ), atapi.IntegerField( 'serviceId', required=False, searchable=False, storage=AnnotationStorage(migrate=True), validators=('isInt', ), widget=atapi.IntegerWidget(description='', label=_(u'Service Id')), ), atapi.ReferenceField( 'contacts', multiValued=True, allowed_types=('Person', ), relationship='contacts_cfp_person', widget=atapi.ReferenceWidget(label=_(u"Contact persons"), ), vocabulary='listContacts', languageIndependent=True, required=False, ), )) ServiceDescriptionSchema['nationalText'].widget.visible = \ {"edit": "invisible", "view": "visible"}
'when the form submission has been confirmed. ' '(If none are available, add one.) ' 'Choose none to display the standard thanks page ' 'of the form.'), ), ), schemata='confirmation', ), atapi.IntegerField( 'expiration_time', required=False, default=7, widget=atapi.IntegerWidget( label=_(u'label_expiration_time', default=u'Expiration time'), description=_( u'label_help_expiration_time', default=( u'Maximum number of days allowed to confirm the form.'), ), ), schemata='confirmation', ), atapi.BooleanField( 'send_standard_mail', required=0, searchable=0, default='1', languageIndependent=1, widget=atapi.BooleanWidget( label=_(u'label_send_standard_mail', default=u'Send standard mail after confirmation'), description=_(
class DefaultBookLayoutExtender(object): """Schema extender, adding the layout-specific fields "release", "author" and "author_address" to the book when the default layout is selected. """ adapts(IBook) implements(ISchemaExtender) fields = [ StringField(name='release', default='', required=False, widget=atapi.StringWidget(label=_(u'book_label_release', default=u'Release'), )), StringField(name='author', default='', required=False, widget=atapi.StringWidget(label=_(u'book_label_author', default=u'Author'), )), TextField(name='author_address', default='', required=False, default_content_type='text/plain', allowable_content_types=('text/plain', ), default_output_type='text/plain', widget=atapi.TextAreaWidget( label=_(u'book_label_author_address', default=u'Author Address'), )), FileField(name='titlepage_logo', required=False, widget=atapi.FileWidget( label=_(u'book_label_titlepage_logo', default=u'Titlepage logo'), description=_(u'book_help_titlepage_logo', default=u'Upload an image or a PDF, which ' u'will be displayed on the titlepage'))), IntegerField(name='titlepage_logo_width', default=0, required=False, size=3, widget=atapi.IntegerWidget( label=_(u'book_label_titlepage_logo_width', default=u'Titlepage logo width (%)'), description=_( u'book_help_titlepage_logo_width', default=u'Width of the titlepage logo in ' u'percent of the content width.'), size=3, maxlength=3)), ] def __init__(self, context): self.context = context def getFields(self): # Checking whether the request provides the # IDefaultBookLayoutSelectionLayer interface does not work when # LinguaPlone is installed. # Looks like this method is called before # BookTraverse.publishTraverse() marks the request with the interface. if self.context.isTemporary(): return [] layout_layer_name = getattr(self.context, 'latex_layout', None) if layout_layer_name: layout_layer = resolve(layout_layer_name) if layout_layer == IDefaultBookLayoutSelectionLayer: return self.fields return []
from Products.ATContentTypes.content import schemata from Products.ATContentTypes.content.schemata import finalizeATCTSchema from jyu.rsslisting.interfaces.rsslisting import IRSSListing from jyu.rsslisting.config import PROJECTNAME from zope.i18nmessageid import Message as _ # requires explicit domain RSSListingSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema(( atapi.IntegerField( 'count', required=True, searchable=True, storage=atapi.AnnotationStorage(), widget=atapi.IntegerWidget( label=_(u'Number of items to display', domain="plone"), description=_(u'How many items to list.', domain="plone")), default=5, ), atapi.TextField( 'url', required=True, searchable=True, # validators=(('isURL'),), storage=atapi.AnnotationStorage(), widget=atapi.TextAreaWidget( label=_(u'List of RSS feed URLs', domain="jyu.rsslisting"), description= _(u'List of links to the RSS feeds to display. Please, enter only one link per line.', domain="jyu.rsslisting")), ),
validators=('isDecimal'), ), atapi.StringField( 'latlong', storage=atapi.AnnotationStorage(), widget=atapi.StringWidget( label=_(u"Latitude Longitude"), description=_(u'formatted as "lat long"'), ), required=False, ), atapi.IntegerField( 'zoom', storage=atapi.AnnotationStorage(), widget=atapi.IntegerWidget( label=_(u"Zoom Level"), description=_(u"0 = No Zoom, 19 = Full Zoom"), ), default=10, validators=('isInt'), ), )) # Set storage on fields copied from ATContentTypeSchema, making sure # they work well with the python bridge properties. simmapSchema['title'].storage = atapi.AnnotationStorage() simmapSchema['description'].storage = atapi.AnnotationStorage() schemata.finalizeATCTSchema(simmapSchema, moveDiscussion=False)
u"You will find data from the form " u"in the `options` var (es: options/comments)")), rows=20, visible={ 'edit': 'visible', 'view': 'invisible' }, ), validators=('zptvalidator', ), ), atapi.IntegerField( 'download_timeout', storage=atapi.AnnotationStorage(), widget=atapi.IntegerWidget( label=_(u"Download Timeout"), description=_(u"How many seconds should pass " u"before downloading the PDF?"), ), validators=('isInt'), default=5, ), )) # Set storage on fields copied from ATContentTypeSchema, making sure # they work well with the python bridge properties. FormToPDFAdapterSchema['title'].storage = atapi.AnnotationStorage() FormToPDFAdapterSchema['description'].storage = atapi.AnnotationStorage() schemata.finalizeATCTSchema(FormToPDFAdapterSchema, moveDiscussion=False)
atapi.DateTimeField('startTime', storage=atapi.AnnotationStorage(), widget=TimeWidget(label=_('Start Time'))), atapi.DateTimeField('endTime', storage=atapi.AnnotationStorage(), widget=TimeWidget(label=_('End Time'))), atapi.StringField('name', storage=atapi.AnnotationStorage(), widget=atapi.StringWidget( label=_('Name'), description=_(u'Optional name'))), atapi.IntegerField('maxCapacity', storage=atapi.AnnotationStorage(), default=1, required=True, widget=atapi.IntegerWidget( label=_(u'Max Capacity'), description=_(u'The max number of people'))), atapi.BooleanField( 'allowWaitingList', storage=atapi.AnnotationStorage(), widget=atapi.BooleanWidget( label=_(u'Allow Waiting List'), description=_(u'Check if you want to allow signups to waiting ' 'list once max capacity is reached'))), )) TimeSlotSchema['title'].required = False TimeSlotSchema['title'].widget.visible = { 'view': 'invisible', 'edit': 'invisible', }
widget=atapi.ComputedWidget(label='Registered objects'), ), atapi.ComputedField( 'allocated', expression='here.renderMemoryValue(here.getAllocatedMemory())', widget=atapi.ComputedWidget(label='Allocated storage'), ), atapi.ComputedField( 'storage_class', expression='here.getStorageClass()', widget=atapi.ComputedWidget(label='Storage class'), ), atapi.IntegerField( 'max_objects', widget=atapi.IntegerWidget( label='Max. Objects', description='Allocated (maximum) number of objects', ), ), atapi.FloatField('cost_factor'), atapi.DateTimeField( 'preserve_until', widget=atapi.CalendarWidget( label='Preserve until', description='Until when does this resource need ' 'to be allocated?', show_hm=False), ), )) + ResourceContextFields.copy() + CommonFields.copy() schemata.finalizeATCTSchema(RegisteredStorageResourceSchema, moveDiscussion=False)
default_method="getDefaultPlayerId", vocabulary_factory="rfa.kaltura.video_players", widget=atapi.SelectionWidget(label="Player", label_msgid="label_kplayerid_msgid", description="Choose the player to use", description_msgid="desc_kplayerid_msgid", i18n_domain="kaltura_video"), ), atapi.IntegerField( 'partnerId', searchable=0, mode='rw', default_method="getDefaultPartnerId", widget=atapi.IntegerWidget( label="Partner Id", label_msgid="label_kpartnerid_msgid", description="Kaltura Partner Id (use default if unsure)", description_msgid="desc_kpartnerid_msgid", i18n_domain="kaltura_video"), ), )) #this seems misnamed KalturaMetadataSchema = atapi.Schema(( atapi.LinesField( 'categories', multiValued=True, searchable=0, required=False, vocabulary="getCategoryVocabulary", accessor="getCategories", mutator="setCategories",
atapi.StringField( 'gender', widget=atapi.SelectionWidget(label="Gender"), vocabulary=genders, ), atapi.DateTimeField( 'dateOfBirth', searchable=1, widget=atapi.CalendarWidget( label="Date of Birth", show_hm=False, ), ), atapi.StringField( 'birthYear', widget=atapi.IntegerWidget(label="Birth Year", ), ), atapi.StringField( 'occupation', widget=atapi.SelectionWidget(label="Occupation"), schemata='professional info', vocabulary=occupations, ), atapi.StringField( 'jobTitle', searchable=1, widget=atapi.StringWidget(label="Job title", ), schemata='professional info', ), atapi.StringField( 'organization',
storage=atapi.AnnotationStorage(), widget=ReferenceBrowserWidget( label=_(u"Private doc"), description=_(u"Choose the private item you are going to share"), startup_directory_method='startupDirectoryMethod', ), required=True, relationship='tokenrolemaileradapter_private_doc', allowed_types=(), # specify portal type names here ('Example Type',) multiValued=False, ), atapi.IntegerField( 'minutes', storage=atapi.AnnotationStorage(), widget=atapi.IntegerWidget( label=_(u"Validity (minutes)"), description=_(u"Type the token validity in minutes"), ), required=True, default=60, validators=('isInt'), ), )) # Set storage on fields copied from ATContentTypeSchema, making sure # they work well with the python bridge properties. TokenRoleMailerAdapterSchema['title'].storage = atapi.AnnotationStorage() TokenRoleMailerAdapterSchema['description'].storage = atapi.AnnotationStorage() TokenRoleMailerAdapterSchema['recipient_name'].widget.visible = { 'edit': 'invisible', 'view': 'invisible'
# -*- Message Factory Imported Here -*- from leam.luc import lucMessageFactory as _ from leam.luc.interfaces import IProbmap from leam.luc.config import PROJECTNAME ProbmapSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- atapi.IntegerField( 'year', storage=atapi.AnnotationStorage(), widget=atapi.IntegerWidget( label=_(u"Effective Year"), description=_( u"Each driver given below should correspond to this year."), ), required=True, default=_(u"2010"), validators=('isInt'), ), atapi.ReferenceField( 'tdm', storage=atapi.AnnotationStorage(), widget=ReferenceBrowserWidget( allow_browse=1, allow_search=1, startup_directory='/luc/drivers/transportation', label=_(u"TDM Transportation Network"), #description=_(u""),
class ProductSchemaExtender(object): _fields = [ ExtendedStringField( schemata='shop', name='product_category', required=False, enforceVocabulary=True, vocabulary_factory='jazkarta.shop.product_categories', widget=atapi.SelectionWidget( label="Product Category", description="Select a product category", description_msgid='help_product_category', )), ExtendedFixedPointField( schemata='shop', name='price', default="0.00", # min=Decimal("0.00"), widget=atapi.DecimalWidget( label="Unit Price", description="", description_msgid='help_price', )), ExtendedIntegerField( schemata='shop', name='stock_level', required=False, # min=0, widget=atapi.IntegerWidget( label="Stock Level", description= "Number of items remaining in warehouse. Leave blank for no limit.", description_msgid='help_stock_level', )), ExtendedBooleanField( schemata='shop', name='taxable', widget=atapi.BooleanWidget( label="Taxable?", description= "Mark the box if this product is subject to sales tax.", description_msgid='help_taxable', ), default=True, ), ExtendedFloatField(schemata='shop', name='weight', required=False, widget=atapi.StringWidget( label="Weight (lbs)", description="Used to calculate shipping.", description_msgid='help_weight', )) ] def __init__(self, context): self.context = context def getFields(self): return self._fields
from rendereasy.origineclub.interfaces import IEvento from rendereasy.origineclub.config import PROJECTNAME from DateTime.DateTime import * from Products.CMFPlone.utils import getToolByName from string import join EventoSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- atapi.IntegerField( 'tempo', storage=atapi.AnnotationStorage(), widget=atapi.IntegerWidget( label=_(u"Tempo"), description=_(u"Informe o tempo em segundos."), ), required=True, default=5, validators=('isInt'), ), atapi.ImageField( 'imagem', storage=atapi.AnnotationStorage(), widget=atapi.ImageWidget( label=_(u"Foto"), ), required=True, validators=('isNonEmptyFile'), ),
atapi.TextField( 'texto', storage=atapi.AnnotationStorage(), widget=atapi.TextAreaWidget( label=_(u"Texto"), ), required=True, ), atapi.IntegerField( 'tempo', storage=atapi.AnnotationStorage(), widget=atapi.IntegerWidget( label=_(u"Tempo"), description=_(u"Field description"), ), validators=('isInt'), ), )) # Set storage on fields copied from ATContentTypeSchema, making sure # they work well with the python bridge properties. TextoSchema['title'].storage = atapi.AnnotationStorage() TextoSchema['description'].storage = atapi.AnnotationStorage() TextoSchema['description'].widget.visible = {"edit": "invisible", "view": "invisible"} TextoSchema['location'].widget.visible = {"edit": "invisible", "view": "invisible"} TextoSchema['language'].widget.visible = {"edit": "invisible", "view": "invisible"}
description=_(u"if cover image not present use " "a random cover from the collection."), ), ), atapi.BooleanField('javascript', schemata='default', default=True, widget=atapi.BooleanWidget( label=_(u"JavaScript"), description=_(u"Enable or disable javascript"))), atapi.IntegerField( 'javascriptdelay', schemata='default', default=0, widget=atapi.IntegerWidget( label=_(u"JavaScript delay"), description=_(u"Wait some seconds for javascript to finish"))), atapi.IntegerField( 'timeout', schemata='default', default=3600, widget=atapi.IntegerWidget( label=_(u"Timeout"), description=_( u"Abort PDF export after specified number of seconds. " u"Use zero to disable it."))), atapi.BooleanField( 'async', schemata='default', default=True, widget=atapi.BooleanWidget(
from Products.Archetypes import atapi from Products.ATContentTypes.content.document import ATDocument SCHEMA = ATDocument.schema.copy() + atapi.Schema(( atapi.StringField('isbn', schemata='book', widget=atapi.StringWidget(label=u'ISBN', description=u'ISBN')), atapi.StringField('link', schemata='book', widget=atapi.StringWidget(label=u'Link', description=u'Book details')), atapi.StringField('publisher', schemata='book', widget=atapi.StringWidget( label=u'Publisher', description=u'Book publisher')), atapi.IntegerField('rating', schemata='book', widget=atapi.IntegerWidget(label=u'Rating', description=u'Book rating')), )) class Book(ATDocument): """ Demo Book """ archetypes_name = meta_type = portal_type = 'Book' _at_rename_after_creation = True schema = SCHEMA
default=u"Detailed information"), description=_( u"help_provider_body", default=u"Enter the details description about this provider."), i18n_domain='ploneservicescenter', ), required=0, searchable=1, ), atapi.IntegerField( 'employees', widget=atapi.IntegerWidget( label=_(u"label_provider_numemployees", default=u"Confidential: Number of employees"), description=_( u"help_provider_numemployees", default= u"Number of full-time employees (Used for statistical purposes only, will never be made public)" ), i18n_domain='ploneservicescenter', ), validators=('isInt', ), read_permission='Manage portal', ), atapi.IntegerField( 'annualRevenues', widget=atapi.IntegerWidget( label=_(u"label_provider_annualrevenues", default=u"Confidential: Annual revenues"), description=_( u"help_provider_annualrevenues", default=