コード例 #1
0
ファイル: FlexibilityReport.py プロジェクト: eea/eea.soer
         ),
     ),

    StringField(
        name='question',
        required=True,
        widget=StringWidget(
            label='Title',
            label_msgid='eea.soer_label_questions',
            i18n_domain='eea.soer',
            description='Custom title for this report',
         ),
     ),
),
                )
schema = getattr(SOERReport, 'schema').copy() + schema.copy()
schema['title'].required = False


class FlexibilityReport(SOERReport):
    """ Flexibility Report
    """
    security = ClassSecurityInfo()
    __implements__ = (getattr(SOERReport, '__implements__', ()), )
    implements(IFlexibilityReport)

    meta_type = 'FlexibilityReport'
    portal_type = 'FlexibilityReport'

    schema = schema
    default_view = 'flexibility_report_view'
コード例 #2
0
ファイル: FSSItem.py プロジェクト: mikejmets/iw.fss
    ImageField('image',
               required=False,
               sizes={
                   'mini': (40, 40),
                   'thumb': (80, 80),
               },
               storage=FileSystemStorage(),
               widget=ImageWidget()),
    TextField('text',
              required=False,
              storage=FileSystemStorage(),
              widget=TextAreaWidget()),
),
                       marshall=PrimaryFieldMarshaller())

FSSItemSchema = BaseSchema.copy() + BaseItemShema.copy()
ATFSSItemSchema = ATContentTypeSchema.copy() + BaseItemShema.copy()


class FSSItem(BaseContent):
    """A simple item using FileSystemStorage"""
    archetypes_name = portal_type = meta_type = 'FSSItem'
    schema = FSSItemSchema
    _at_rename_after_creation = True


registerType(FSSItem, PROJECTNAME)


class ATFSSItem(ATCTContent):
    """A simple item using FileSystemStorage base on ATContentypes"""
コード例 #3
0
ファイル: SOERReport.py プロジェクト: eea/eea.soer
        widget=SelectionWidget(
            label='Evaluation',
            label_msgid='label_evaluation',
            description='This is a two letter value which indicates quickly '
            'what the evaluation and trend is.',
            visible={
                'view': 'invisible',
                'edit': 'invisible'
            },
            format='select',
        ),
        vocabulary='getEvaluationVocabulary',
    ),
), )

schema = getattr(ATFolder, 'schema', Schema(())).copy() + schema.copy()
schema['title'].default = 'not_set_yet'
schema['title'].required = 0
schema['title'].widget.visible = {'edit': 'invisible'}
schema['description'].widget.description = \
                     '(Optional) ' + schema['description'].widget.description
schema['soerCountry'].default_method = 'default_country'
schema['relatedItems'].widget.visible = {'edit': 'visible'}
schema['relatedItems'].schemata = 'metadata'


class SOERReport(ATFolder, ATNewsItem):
    """ SOER Report
    """
    security = ClassSecurityInfo()
    __implements__ = (getattr(ATFolder, '__implements__', ()), )
コード例 #4
0
ファイル: SOERReport.py プロジェクト: eea/eea.soer
        default=u'http://www.eea.europa.eu/soer/evaluations#XX',
        widget=SelectionWidget(
            label='Evaluation',
            label_msgid='label_evaluation',
            description='This is a two letter value which indicates quickly '
                        'what the evaluation and trend is.',
            visible={'view' : 'invisible',
                     'edit' : 'invisible'},
            format='select',
        ),
        vocabulary='getEvaluationVocabulary',
    ),
),
)

schema = getattr(ATFolder, 'schema', Schema(())).copy() + schema.copy()
schema['title'].default = 'not_set_yet'
schema['title'].required = 0
schema['title'].widget.visible = {'edit' : 'invisible'}
schema['description'].widget.description = \
                     '(Optional) ' + schema['description'].widget.description
schema['soerCountry'].default_method = 'default_country'
schema['relatedItems'].widget.visible = {'edit' : 'visible'}
schema['relatedItems'].schemata = 'metadata'

class SOERReport(ATFolder, ATNewsItem):
    """ SOER Report
    """
    security = ClassSecurityInfo()
    __implements__ = (getattr(ATFolder, '__implements__', ()), )
    implements(ISOERReport)
コード例 #5
0
        # not 'roles' b/c 'validate_roles' exists; stoopid Archetypes
        name="roles_",
        accessor='getRoles',
        languageIndependent=1,
        vocabulary='getRoleSet',
        multiValued=1,
        widget=MultiSelectionWidget(
            label=_(u"Roles"),
            description=_(u"Roles that members of this group should receive."),
            visible = False
            ),
        ),

),)

SimpleSchema = getattr(ATBTreeFolder, 'schema', Schema(())).copy() + schema.copy()

# Ugly hack to hide metadata fields
for field in SimpleSchema.fields():
    if field.isMetadata:
        field.schemata = 'default'
        field.widget.visible = False
        
DescField = SimpleSchema['description']
DescField.widget.visible = True

AdminField = SimpleSchema['administators']
AdminField.widget.label=_(u'Administrators')

InstField = SimpleSchema['instuctors']
InstField.widget.label=_(u'Instructors')
コード例 #6
0
ファイル: FSSItem.py プロジェクト: LEAMgroup/iw.fss
                  i18n_domain="plone",
                  show_content_type=False,)),
    ImageField('image',
               required=False,
               sizes={
                   'mini':(40,40),
                   'thumb':(80,80),},
               storage=FileSystemStorage(),
               widget=ImageWidget()),
    TextField('text',
              required=False,
              storage=FileSystemStorage(),
              widget=TextAreaWidget()),
    ), marshall=PrimaryFieldMarshaller())

FSSItemSchema = BaseSchema.copy() + BaseItemShema.copy()
ATFSSItemSchema = ATContentTypeSchema.copy() + BaseItemShema.copy()

class FSSItem(BaseContent):
    """A simple item using FileSystemStorage"""
    archetypes_name = portal_type = meta_type = 'FSSItem'
    schema = FSSItemSchema
    _at_rename_after_creation = True


registerType(FSSItem, PROJECTNAME)

class ATFSSItem(ATCTContent):
    """A simple item using FileSystemStorage base on ATContentypes"""
    archetypes_name = portal_type = meta_type = 'ATFSSItem'
    schema = ATFSSItemSchema
コード例 #7
0
ファイル: FlexibilityReport.py プロジェクト: eea/eea.soer
         ),
     ),

    StringField(
        name='question',
        required=True,
        widget=StringWidget(
            label='Title',
            label_msgid='eea.soer_label_questions',
            i18n_domain='eea.soer',
            description='Custom title for this report',
         ),
     ),
),
)
schema = getattr(SOERReport, 'schema').copy() + schema.copy()
schema['title'].required = False

class FlexibilityReport(SOERReport):
    """ Flexibility Report
    """
    security = ClassSecurityInfo()
    __implements__ = (getattr(SOERReport, '__implements__', ()), )
    implements(IFlexibilityReport)

    meta_type = 'FlexibilityReport'
    portal_type = 'FlexibilityReport'

    schema = schema
    default_view = 'flexibility_report_view'