コード例 #1
0

logger = logging.getLogger("gcommons.Core.lib.container")


#
# Schema
#
gcContainerSchema_base = atapi.Schema ((
    atapi.LinesField(        
        name = 'txtEditors',
        storage = atapi.AnnotationStorage(),
        widget = atapi.LinesWidget(            
            condition="here/condition_txtEditors",
            label="Editorial Board",    #Guest Editors/Comittee      
            description="Enter the user ids of the users who compose the EB and are able to manage this journal, one per line.",            
            label_msgid='gcommons_label_editors',            
            description_msgid='gcommons_help_editors',            
            i18n_domain='gcommons.Core',        
        ),        
        default_method="getDefaultEditors"    
    ),

    atapi.ReferenceField(
        name='refEditors',
        relationship = 'refEditors',
        required = False,
        multiValued = True,
        searchable=1,
        allowed_types=('gcPerson',),
        storage=atapi.AnnotationStorage(),
コード例 #2
0
     widget=atapi.SelectionWidget(
         label=_(u"label_psc_country_cat", default=u"Country"),
         description=_(u"help_services_country",
                       default=u"Select a country"),
         i18n_domain='ploneservicescenter',
         macro_edit="country_widget"),
     required=0,
     index=('KeywordIndex:schema', ),
 ),
 atapi.LinesField(
     'industry',
     validators=IndustriesValidator('validateIndustries'),
     widget=atapi.MultiSelectionWidget(
         label=_(u"label_psc_industry_cat", default=u"Industry"),
         description=_(u"help_services_industry",
                       default=u"Select a industry from the below list."),
         i18n_domain='ploneservicescenter',
     ),
     required=0,
     vocabulary='getIndustryVocabulary',
     index=('KeywordIndex:schema', ),
 ),
 public.LinkField(
     'url',
     widget=public.LinkWidget(
         label=_(u"label_services_url", default=u"URL"),
         description=_(
             u"help_services_url",
             default=
             u"Enter the web address (URL). You can copy & paste this from a browser window."
         ),
コード例 #3
0
    def overrideDiscussionFor(self, content, allowDiscussion):
        pass


MULTIPLEFIELD_LIST = atapi.DisplayList((
    ('1', _(u'Option 1 : printemps')),
    ('2', unicode('Option 2 : \xc3\xa9t\xc3\xa9',
                  'utf-8')),  # e-acute t e-acute
    ('3', u'Option 3 : automne'),
    ('4', _(u'option3', default=u'Option 3 : hiver')),
))

schema = atapi.BaseSchema + atapi.Schema((
    atapi.LinesField(
        'MULTIPLEFIELD',
        searchable=1,
        vocabulary=MULTIPLEFIELD_LIST,
        widget=atapi.MultiSelectionWidget(i18n_domain='plone', ),
    ),
    atapi.TextField(
        'TEXTFIELD',
        primary=True,
    ),
))


class Dummy(atapi.BaseContent):

    portal_discussion = DummyDiscussionTool()

    def getCharset(self):
        return 'utf-8'
コード例 #4
0
        return self.getAvailableProducts()

    def setAvailableProducts(self, value, **kw):
        """ set vocabulary """
        self.fgField.vocabulary = get_selected_products(self, value)

    def htmlValue(self, REQUEST):
        """ return product title instead of uid """
        value = REQUEST.form.get(self.__name__, 'No Input')
        return value.split('|')[0]

JazShopMultiSelectFieldSchema = BaseFieldSchemaStringDefault.copy() + atapi.Schema((
    atapi.LinesField('availableProducts',
        searchable=False,
        required=True,
        widget=atapi.MultiSelectionWidget(),
        vocabulary_factory='jazkarta.pfg.jazshop.available_products',
        multiValued=True,
    ),
    atapi.StringField('selectionFormat',
        vocabulary=('select', 'checkbox'),
        enforceVocabulary=True,
        widget=atapi.SelectionWidget(format='radio'),
        required=True,
    ),
))

schemata.finalizeATCTSchema(JazShopMultiSelectFieldSchema, moveDiscussion=False)


class JazShopMultiSelectStringField(BaseFormField):
コード例 #5
0
     storage=atapi.AnnotationStorage(),
     widget=atapi.BooleanWidget(
         label=_(u'Allow Signup For Multiple Slots'),
         description=_(
             u'Allow the user to signup for more than one slot.'))),
 atapi.StringField(
     'showSlotNames',
     storage=atapi.AnnotationStorage(),
     widget=atapi.BooleanWidget(
         label=_(u'Show Individual Time Slot Names'),
         description=_(u'Whether or not to show individual slot names.'))),
 atapi.LinesField(
     'extraFields',
     storage=atapi.AnnotationStorage(),
     vocabulary="getExtraFieldsVocabulary",
     widget=atapi.MultiSelectionWidget(
         label=_(u'Extra Fields'),
         description=_(u'Information you want to collect from users besides'
                       ' just name and email.'),
         format='checkbox')),
 atapi.LinesField(
     'contactInfo',
     storage=atapi.AnnotationStorage(),
     widget=atapi.LinesWidget(
         label=_(u'Contact Information'),
         description=_(u'Contact information for the manager of the signup'
                       ' sheet.'))),
 atapi.LinesField(
     'extraEmailContent',
     storage=atapi.AnnotationStorage(),
     widget=atapi.LinesWidget(
コード例 #6
0
ファイル: pauta.py プロジェクト: lflrocha/ebc.pauta
       name='data',
       widget=atapi.CalendarWidget(
           label="Data",
           show_hm=False,
           format='%d/%m/%Y',
           starting_year='2012',
           ),
        required='true',
        default_method = 'getDefaultTime',
        validators=('isValidDate',),        
    ),

    atapi.LinesField(
        name='produtor',
        widget=atapi.InAndOutWidget(
            label="Produtor",
        ),
        vocabulary='getListaProdutores',
    ),

    atapi.LinesField(
        name='editor',
        widget=atapi.InAndOutWidget(
            label="Editor",
        ),
        vocabulary='getListaEditores',
    ),

    atapi.LinesField(
        name='reporter',
        widget=atapi.InAndOutWidget(
コード例 #7
0
            description=_(
                u"ENL_content_aggregation_sources_desc",
                default=u"Choose sources to aggregate newsletter content from."
            ),
        ),
    ),

    atapi.LinesField(
        'salutations',
        default=("mr|Dear Mr.", "ms|Dear Ms.", "default|Dear"),
        schemata='personalization',
        widget=atapi.LinesWidget(
            label=_(
                u'EasyNewsletter_label_salutations',
                default=u"Subscriber Salutations."),
            description=_(
                u"EasyNewsletter_help_salutations",
                default=u'Define here possible salutations for subscriber. \
                    One salutation per line in the form of: \"mr|Dear Mr.\". \
                    The left hand value "mr" or "ms" is mapped to salutation \
                    of each subscriber and then the right hand value, which \
                    you can customize is used as salutation.'),
            i18n_domain='EasyNewsletter',
        ),
    ),

    atapi.StringField(
        'fullname_fallback',
        default="Sir or Madam",
        schemata='personalization',
        widget=atapi.StringWidget(
            label=_(
コード例 #8
0
     widget=atapi.StringWidget(
         label=u'Product Title',
         label_msgid='product_title',
         description=
         u"Title of products when using the project view. For example, 'Add-on Product', 'Extension', or 'Template'.",
         i18n_domain='collective.TemplateUploadCenter',
     ),
 ),
 atapi.LinesField(
     'availableVersions',
     default=[
         'LibreOffice 3.3',
         'LibreOffice 3.4',
         'LibreOffice 3.5',
     ],
     widget=atapi.LinesWidget(
         label=u'Available Versions',
         description=
         u'Define the vocabulary for versions of LibreOffice that the templates can be listed as being compatible with. The first item will be the default selection.',
         i18n_domain='collective.TemplateUploadCenter',
         rows=6,
     ),
 ),
 atapi.LinesField(
     'availablePlatforms',
     default=[
         'All platforms', 'Linux', 'Linux-x64', 'Mac OS X', 'Windows',
         'BSD', 'UNIX (other)'
     ],
     widget=atapi.LinesWidget(
         label=u'Platforms',
コード例 #9
0
            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",
        widget=atapi.MultiSelectionWidget(
            label="Categories",
            label_msgid="label_kvideofile_categories",
            description="Select video category(ies) this playlist will provide",
            description_msgid="desc_kvideofile_categories",
            i18n_domain="kaltura_video"),
    ),
    atapi.LinesField(
        'tags',
        multiValued=True,
        searchable=0,
        required=False,
        accessor="getTags",
        mutator="setTags",
        widget=atapi.LinesWidget(
コード例 #10
0
              widget=atapi.StringWidget(
                        label=_(u'Table caption'),
                        description=_('help_table_caption',
                                      default=u'Optional summary of table contents'),
                        size=50,
                        visible={'view': 'invisible', 'edit': 'visible'},
            ),
    ),

    atapi.LinesField('cssClasses',
              required=False,
              searchable=False,
              vocabulary='getCSSClassesVocabulary',
              default=["listing"],
              widget=atapi.MultiSelectionWidget(
                        label=_(u'CSS classes'),
                        description=_(u'CSS classes to be applied to the table.\n'
                                      u'This list is taken from available TinyMCE style for tables.'),
                        format="checkbox",
                        visible={'view': 'invisible', 'edit': 'visible'},
                        condition="object/getCSSClassesVocabulary",
            ),
    ),

    atapi.ComputedField('text',
        expression="object/getText",
        searchable=True,
        widget=atapi.ComputedWidget(
            label=ATDocumentSchema['text'].widget.label,
            description=ATDocumentSchema['text'].widget.description,
        )
    ),
コード例 #11
0
# -*- Message Factory Imported Here -*-
from msd.oxtalks import oxtalksMessageFactory as _

from msd.oxtalks.interfaces import IOxfordTalksCollection
from msd.oxtalks.config import PROJECTNAME

OxfordTalksCollectionSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-

    atapi.LinesField(
        'feeds',
        storage=atapi.AnnotationStorage(),
        widget=atapi.LinesWidget(
            label=_(u"Feeds"),
            description=_(u"Enter the URLs of the feeds you want to use"),
        ),
        required=True,
        default= ["http://talks.ox.ac.uk/api/talks/search?from=today&organising_department=oxpoints:23232740",],
    ),
    
    atapi.StringField(
        'limitNum',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"Limit"),
            description=_(u"Enter the number of items to show"),
        ),
        required=True,
        default=_(u"10"),
    ),
コード例 #12
0
     widget=atapi.StringWidget(
         label=_(u"label_variation1_attr",
                 default=u"Variation 1 Attribute"),
         description=_(u"desc_variation1_attr", default=u""),
         visible={
             'view': 'invisible',
             'edit': 'invisible'
         },
     ),
 ),
 atapi.LinesField(
     'variation1_values',
     required=0,
     widget=atapi.LinesWidget(
         label=_(u"label_variation1_values", default=u"Variation 1 Values"),
         description=_(u"desc_variation1_values", default=u""),
         visible={
             'view': 'invisible',
             'edit': 'invisible'
         },
     ),
 ),
 atapi.StringField(
     'variation2_attribute',
     required=0,
     widget=atapi.StringWidget(
         label=_(u"label_variation2_attr",
                 default=u"Variation 2 Attribute"),
         description=_(u"desc_variation2_attr", default=u""),
         visible={
             'view': 'invisible',
             'edit': 'invisible'
コード例 #13
0
    from Products.CMFPlone.factory import _IMREALLYPLONE5  # noqa
except ImportError:
    from archetypes.querywidget.field import QueryField
else:
    from plone.app.collection.field import QueryField

PROJECTNAME = 'plone.restapi.tests'

ATTestDocumentSchema = ATDocumentSchema.copy() + atapi.Schema((
    atapi.StringField('testStringField'),
    atapi.BooleanField('testBooleanField'),
    atapi.IntegerField('testIntegerField'),
    atapi.FloatField('testFloatField'),
    atapi.FixedPointField('testFixedPointField'),
    atapi.DateTimeField('testDateTimeField'),
    atapi.LinesField('testLinesField'),
    atapi.FileField('testFileField'),
    atapi.TextField('testTextField'),
    atapi.ImageField('testImageField'),
    atapi.ReferenceField('testReferenceField', relationship='testrelation'),
    atapi.ReferenceField(
        'testMVReferenceField', relationship='testrelation', multiValued=True),
    BlobField('testBlobField'),
    FileField('testBlobFileField'),
    ImageField('testBlobImageField'),
    QueryField('testQueryField'),
    atapi.StringField('testRequiredField', required=True),
    atapi.StringField('testReadonlyField', mode='r'),
    atapi.StringField('testWriteonlyField', mode='w'),
    atapi.StringField('testReadPermissionField',
                      read_permission=permissions.ManagePortal),
コード例 #14
0
ファイル: common.py プロジェクト: EUDAT-DPMT/pcp.contenttypes
        'ticketid',
        widget=atapi.StringWidget(
            label="Ticket ID",
            description="Once a ticket in EUDAT's Trouble Ticket "
            "System (TTS) has been created its ID can be entered "
            "here for easy reference.",
        ),
    ),
))

ConditionsFields = atapi.Schema((
    atapi.LinesField(
        'scopes',
        required=1,
        vocabulary=NamedVocabulary('scope_vocabulary'),
        widget=atapi.MultiSelectionWidget(
            description='Tick all that apply. '
            'If in doubt, select "EUDAT".',
            format='checkbox',
        ),
    ),
    ateapi.CommentField(
        'conditions',
        comment='Any constraints that need to be satisfied by the '
        'customer:',
    ),
    atapi.StringField(
        'regional_constraints',
        searchable=True,
        widget=atapi.StringWidget(label='Regional constraints'),
    ),
    atapi.StringField(
コード例 #15
0
from Products.ATContentTypes.lib.historyaware import HistoryAwareMixin

#Libs

# Product imports
from lx.demanda import demandaMessageFactory as _
from lx.demanda.interfaces.contents import ISecao
from lx.demanda import config

# Schema definition
schema = ATFolder.schema.copy() + atapi.Schema((
    atapi.LinesField(
        name='lista_os',
        required=False,
        searchable=True,
        widget=atapi.LinesWidget(
            label=_(u"Lista de OS"),
            description=_(u"Lista de OS"),
            size=10,)
    ),
),)

schemata.finalizeATCTSchema(schema)


class Secao(ATFolder, HistoryAwareMixin):
    """
    """
    security = ClassSecurityInfo()
    implements(ISecao)
コード例 #16
0
# -*- coding: utf-8 -*-
from AccessControl import ClassSecurityInfo
from Products.Archetypes import atapi
from Products.ATContentTypes.content.folder import ATBTreeFolder
from Products.CMFCore.utils import getToolByName
from Products.feedfeeder import _
from Products.feedfeeder.config import PROJECTNAME
from Products.feedfeeder.interfaces.container import IFeedsContainer
from zope import interface

schema = atapi.Schema((
    atapi.LinesField(
        name='feeds',
        widget=atapi.LinesWidget(description=_(
            "help_feeds",
            default="List of rss feeds. You can prefix feed link titles "
            "using | separator. It is probably a good idea to add a colon "
            "or dash at the end of the prefix "
            "('My place: |http://myplace/feed')."),
                                 label=_('feedfeeder_label_feeds',
                                         default='Feeds'))),
    atapi.BooleanField(
        name='redirect',
        widget=atapi.BooleanWidget(
            description=_(
                "help_redirect",
                default="If checked the feed item will be automatically "
                "redirected if you don't have the edit permission."),
            label=_('label_redirect',
                    default='Automatic redirect of feed items'))),
    atapi.StringField(
        name='defaultTransition',
コード例 #17
0
            accessor='end',
            default_method='default_end_date',

            widget=FtwCalendarWidget(
                label=_(u'task_label_end_date', default=u'End of Task'),
                description=_(u'task_help_end_date',
                              default=u'Enter the ending date and time, '
                              'or click the calendar icon and select it.'))),

        atapi.LinesField(
            name='responsibility',
            required=False,
            searchable=True,
            vocabulary_factory='ftw.task.users',

            widget=atapi.MultiSelectionWidget(
                size=4,
                format='checkbox',
                label=_(u'task_label_responsibility',
                        default=u'Responsibility'),
                description=_(u'task_help_responsibility',
                              default=u'Select the responsible person(s).'))),

        atapi.ReferenceField(
            name='related_items',
            relationship='relatesTo',
            multiValued=True,
            isMetadata=True,
            languageIndependent=False,
            index='KeywordIndex',
            schemata='default',
コード例 #18
0
    from Products.CMFPlone.factory import _IMREALLYPLONE5  # noqa
except ImportError:
    from archetypes.querywidget.field import QueryField
else:
    from plone.app.collection.field import QueryField

PROJECTNAME = "plone.restapi.tests"

ATTestDocumentSchema = ATDocumentSchema.copy() + atapi.Schema((
    atapi.StringField("testStringField"),
    atapi.BooleanField("testBooleanField"),
    atapi.IntegerField("testIntegerField"),
    atapi.FloatField("testFloatField"),
    atapi.FixedPointField("testFixedPointField"),
    atapi.DateTimeField("testDateTimeField"),
    atapi.LinesField("testLinesField"),
    atapi.FileField("testFileField"),
    atapi.TextField("testTextField"),
    atapi.ImageField("testImageField"),
    atapi.ReferenceField("testReferenceField", relationship="testrelation"),
    atapi.ReferenceField(
        "testMVReferenceField", relationship="testrelation", multiValued=True),
    BlobField("testBlobField"),
    FileField("testBlobFileField"),
    ImageField("testBlobImageField"),
    QueryField("testQueryField"),
    atapi.StringField("testRequiredField", required=True),
    atapi.StringField("testReadonlyField", mode="r"),
    atapi.StringField("testWriteonlyField", mode="w"),
    atapi.StringField("testReadPermissionField",
                      read_permission=permissions.ManagePortal),
コード例 #19
0
from zope.interface import implements

from bika.lims.config import PROJECTNAME
from bika.lims.content.person import Person
from bika.lims.content.contact import Contact
from bika.lims.interfaces import ILabContact
from bika.lims import deprecated
from bika.lims import logger
from bika.lims import bikaMessageFactory as _
from bika.lims import deprecated

schema = Person.schema.copy() + atapi.Schema((
    atapi.LinesField('PublicationPreference',
                     vocabulary_factory=
                     'bika.lims.vocabularies.CustomPubPrefVocabularyFactory',
                     default='email',
                     schemata='Publication preference',
                     widget=atapi.MultiSelectionWidget(
                         label=_("Publication preference"), )),
    atapi.ImageField(
        'Signature',
        widget=atapi.ImageWidget(
            label=_("Signature"),
            description=_(
                "Upload a scanned signature to be used on printed analysis "
                "results reports. Ideal size is 250 pixels wide by 150 high"),
        )),
    atapi.ReferenceField(
        'Departments',
        required=0,
        vocabulary_display_path_bound=sys.maxint,
コード例 #20
0
     validators=('isEmail', ),
     widget=atapi.StringWidget(
         label=_(u"EasyNewsletter_label_testEmail", default=u"Test email"),
         description=_(u"EasyNewsletter_help_testEmail",
                       default=u"Default for the test email address."),
         i18n_domain='EasyNewsletter',
     ),
 ),
 atapi.LinesField(
     'salutations',
     default=("mr|Dear Mr.", "ms|Dear Ms.", "default|Dear"),
     widget=atapi.LinesWidget(
         label=_(u'EasyNewsletter_label_salutations',
                 default=u"Subscriber Salutations."),
         description=_(
             u"EasyNewsletter_help_salutations",
             default=u'Define here possible salutations for subscriber. One \
                 salutation per line in the form of: \"mr|Dear Mr.\". \
                 The left hand value "mr" or "ms" is mapped to salutation of \
                 each subscriber and then the right hand value, which you \
                 can customize is used as salutation.'),
         i18n_domain='EasyNewsletter',
     ),
 ),
 atapi.StringField(
     'fullname_fallback',
     default="Sir or Madam",
     widget=atapi.StringWidget(
         label=_(u'EasyNewsletter_label_fullname_fallback',
                 default=u"Fallback for subscribers without a name."),
         description=_(
             u"EasyNewsletter_help_fullname_fallback",
コード例 #21
0
                          label=_(u"gcommonsUsers_label_email",
                                  default=u"Email"),
                          i18n_domain='gcommons.Users',
                      ),
                      schemata="Basic Information",
                      searchable=True,
                      validators=('isEmail', )),

    #
    # Schemata: Professional Information
    #
    atapi.LinesField(name='jobTitles',
                     storage=atapi.AnnotationStorage(),
                     widget=atapi.LinesField._properties['widget'](
                         label=_(u"Job Titles"),
                         description=_(u"One per line"),
                         i18n_domain='gcommons.Users',
                     ),
                     schemata="Professional Information",
                     searchable=True),
    atapi.TextField(name='biography',
                    widget=atapi.RichWidget(
                        label=_(u"Biography"),
                        i18n_domain='gcommons.Users',
                    ),
                    schemata="Professional Information",
                    searchable=True,
                    validators=('isTidyHtmlWithCleanup', ),
                    default_output_type='text/x-html-safe',
                    user_property='description'),
    atapi.LinesField(name='education',
コード例 #22
0
    atapi.DateTimeField(
        'closingDate',
        required=True,
        storage=atapi.AnnotationStorage(),
        default_method='getCurrentDate',
        widget=atapi.CalendarWidget(
            label=_(u'Closing Date'),
            description=_(u'Date when applications close.'),
            show_hm=False,
        ),
    ),
    atapi.LinesField(
        'loiDates',
        required=False,
        storage=atapi.AnnotationStorage(),
        widget=atapi.LinesWidget(
            label=_(u'Letters-of-Intent Dates'),
            description=_(u'Dates when letters-of-intent for this announcement are due, in the ISO format YYYY-MM-DD,' \
                + ' one per line.'),
        ),
    ),
    atapi.LinesField(
        'appReceiptDates',
        required=False,
        storage=atapi.AnnotationStorage(),
        widget=atapi.LinesWidget(
            label=_(u'Application Receipt Dates'),
            description=_(u'Dates when applications must be received, in the ISO format YYYY-MM-DD, one per line.'),
        ),
    ),
))
AnnouncementSchema['title'].storage = atapi.AnnotationStorage()
コード例 #23
0
ファイル: projectroom.py プロジェクト: tlyng/intranett
from zope.component import getUtility
from zope.interface import implements
from zope.lifecycleevent.interfaces import IObjectAddedEvent
from zope.lifecycleevent.interfaces import IObjectRemovedEvent
from zope.schema.interfaces import IVocabularyFactory

from intranett.policy import IntranettMessageFactory as _
from intranett.policy.config import PROJECTNAME
from intranett.policy.interfaces import IProjectRoom

ProjectRoomSchema = ATFolder.schema.copy() + atapi.Schema((atapi.LinesField(
    'participants',
    required=False,
    multiValued=True,
    vocabulary='getParticipantsVocabulary',
    storage=atapi.AnnotationStorage(),
    widget=atapi.MultiSelectionWidget(
        label=_(u"Participants"),
        description=_(u"Users who have access to the project room."),
        format='checkbox',
    ),
), ))


class ProjectRoom(ATFolder):
    """A project room for groups of participants"""

    implements(IProjectRoom)
    schema = ProjectRoomSchema
    meta_type = "ProjectRoom"
    security = ClassSecurityInfo()
コード例 #24
0
             SelectColumn("Ora inizio pomeriggio",
                          vocabulary="vocOreInizio",
                          default=""),
             "end_p":
             SelectColumn("Ora fine pomeriggio",
                          vocabulary="vocOreInizio",
                          default=""),
         }),
     required=True,
 ),
 atapi.LinesField(
     'festivi',
     storage=atapi.AnnotationStorage(),
     widget=atapi.LinesWidget(
         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"
コード例 #25
0
fields = [
    'StringField', 'FileField', 'TextField', 'DateTimeField', 'LinesField',
    'IntegerField', 'FloatField', 'FixedPointField', 'BooleanField',
    'ImageField'
]

field_instances = []

for f in fields:
    field_instances.append(getattr(Field, f)(f.lower()))

schema = atapi.Schema(
    tuple(field_instances) + (
        atapi.LinesField(
            'selectionlinesfield1',
            vocabulary='_get_selection_vocab',
            enforceVocabulary=1,
            widget=atapi.SelectionWidget(label='Selection'),
        ),
        atapi.LinesField(
            'selectionlinesfield2',
            vocabulary='_get_selection_vocab',
            widget=atapi.SelectionWidget(label='Selection',
                                         i18n_domain="attesti18n"),
        ),
        atapi.LinesField(
            'selectionlinesfield3',
            vocabulary='_get_selection_vocab2',
            widget=atapi.MultiSelectionWidget(label='MultiSelection',
                                              i18n_domain="attesti18n"),
        ),
        atapi.TextField(
コード例 #26
0
            label='Required',
            label_msgid='widget_required_title',
            description=('Select this if you want to make this relation '
                         'mandatory (action: edit)'),
            description_msgid='widget_required_description',
            i18n_domain="eea"
        )
    ),
    atapi.LinesField('required_for',
        schemata='default',
        vocabulary_factory='eea.relations.voc.workflowstates',
        widget=atapi.MultiSelectionWidget(
            format='checkbox',
            label='Required for',
            label_msgid='widget_required_for_title',
            description=('Select workflow states that will require this '
                         'relation before setup (action: change state). '
                         'You will also have to update workflow '
                         'transitions accordingly'),
            description_msgid='widget_required_for_description',
            i18n_domain="eea"
        )
    ),
))

EditSchema = ATFolder.schema.copy() + RelationSchema.copy()
EditSchema.moveField('title', after='to')
EditSchema.moveField('description', after='backward_label')

class EEAPossibleRelation(ATFolder):
    """ Relation
コード例 #27
0
ファイル: client.py プロジェクト: udithap/Bika-LIMS
     widget=atapi.BooleanWidget(label=_("Member discount applies"), ),
 ),
 atapi.StringField(
     'ClientType',
     required=1,
     default='noncorporate',
     write_permission=ManageClients,
     vocabulary=CLIENT_TYPES,
     widget=atapi.SelectionWidget(label=_("Client Type"), ),
 ),
 atapi.LinesField(
     'EmailSubject',
     schemata=PMF('Preferences'),
     default=[
         'ar',
     ],
     vocabulary=EMAIL_SUBJECT_OPTIONS,
     widget=atapi.MultiSelectionWidget(
         description=_('Items to be included in email subject lines'),
         label=_("Email subject line"),
     ),
 ),
 atapi.ReferenceField(
     'DefaultCategories',
     schemata=PMF('Preferences'),
     required=0,
     multiValued=1,
     vocabulary='getAnalysisCategories',
     vocabulary_display_path_bound=sys.maxint,
     allowed_types=('AnalysisCategory', ),
     relationship='ClientDefaultCategories',
     widget=atapi.ReferenceWidget(
コード例 #28
0
from Products.Archetypes import atapi
from Products.ATContentTypes.content import base
from Products.ATContentTypes.content import schemata

# -*- Message Factory Imported Here -*-

from pcp.contenttypes.interfaces import IServiceComponentImplementationDetails
from pcp.contenttypes.config import PROJECTNAME
from pcp.contenttypes.content.common import CommonFields
from pcp.contenttypes.content.common import CommonUtilities

ServiceComponentImplementationDetailsSchema = schemata.ATContentTypeSchema.copy(
) + atapi.Schema((
    atapi.StringField('version'),
    atapi.LinesField('configuration_parameters'),
)) + CommonFields.copy()

ServiceComponentImplementationDetailsSchema[
    'configuration_parameters'].widget.label = 'Configuration parameters'

schemata.finalizeATCTSchema(ServiceComponentImplementationDetailsSchema,
                            moveDiscussion=False)


class ServiceComponentImplementationDetails(base.ATCTContent, CommonUtilities):
    """Details of a specific implementation of a service component"""
    implements(IServiceComponentImplementationDetails)

    meta_type = "ServiceComponentImplementationDetails"
    schema = ServiceComponentImplementationDetailsSchema
コード例 #29
0
    ),
    atapi.ComputedField('end_date',        
        searchable=1,        
        expression='context._end_date()',       
    ),
    atapi.ComputedField('duration',
        searchable=1,        
        expression='context._duration()',       
    ),


    atapi.LinesField(
        name='agenda',
        widget = atapi.LinesWidget(
            label="Agenda topics",
            description="Add here proposed topics for the meeting.",
            i18n_domain='gcommons.Journal',
        ),
        searchable=True,
    ),


    atapi.ReferenceField('readingList',
        relationship = 'reading',
        multiValued = True,
        keepReferencesOnCopy = True,
        widget = ReferenceBrowserWidget(
            allow_search = True,
            allow_browse = True,
            show_indexes = False,
            force_close_on_insert = False,
コード例 #30
0
GrupoSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-
    atapi.ComputedField(
        'quantidade',
        storage=atapi.AnnotationStorage(),
        widget=atapi.ComputedWidget(
            label=_(u"Quantidade"),
            description=_(u"Quantidade de telefones cadastrados."),
        ),
        expression="context.numTelefones()"),
    atapi.LinesField(
        'telefones',
        storage=atapi.AnnotationStorage(),
        widget=atapi.LinesWidget(
            label=_(u"Telefones"),
            description=_(u"Um por linha, no formato 6199999999."),
        ),
    ),
))

# Set storage on fields copied from ATContentTypeSchema, making sure
# they work well with the python bridge properties.

GrupoSchema['title'].widget.label = _(u"Nome do grupo")
GrupoSchema['title'].storage = atapi.AnnotationStorage()
GrupoSchema['description'].storage = atapi.AnnotationStorage()
GrupoSchema['location'].widget.visible = {
    "edit": "invisible",
    "view": "invisible"
}