(3, CLASSIFICATION_CLASSIFIED), ) grok.global_utility( utils.create_restricted_vocabulary( IClassification['classification'], CLASSIFICATION_OPTIONS, message_factory=_), provides=schema.interfaces.IVocabularyFactory, name=u'classification_classification_vocabulary') form.default_value(field=IClassification['classification'])( utils.set_default_with_acquisition( field=IClassification['classification'], default=CLASSIFICATION_UNPROTECTED ) ) # PUBLIC: Vocabulary and default value PUBLIC_TRIAL_UNCHECKED = u'unchecked' PUBLIC_TRIAL_PUBLIC = u'public' PUBLIC_TRIAL_PRIVATE = u'private' PUBLIC_TRIAL_OPTIONS = ( (1, PUBLIC_TRIAL_UNCHECKED), (2, PUBLIC_TRIAL_PUBLIC), (3, PUBLIC_TRIAL_PRIVATE), )
# Option- # Option Name # level # (1, CLASSIFICATION_UNPROTECTED), (2, CLASSIFICATION_CONFIDENTIAL), (3, CLASSIFICATION_CLASSIFIED), ) grok.global_utility(utils.create_restricted_vocabulary( IClassification['classification'], CLASSIFICATION_OPTIONS, message_factory=_), provides=schema.interfaces.IVocabularyFactory, name=u'classification_classification_vocabulary') form.default_value(field=IClassification['classification'])( utils.set_default_with_acquisition(field=IClassification['classification'], default=CLASSIFICATION_UNPROTECTED)) # PUBLIC: Vocabulary and default value PUBLIC_TRIAL_UNCHECKED = u'unchecked' PUBLIC_TRIAL_PUBLIC = u'public' PUBLIC_TRIAL_PRIVATE = u'private' PUBLIC_TRIAL_OPTIONS = ( (1, PUBLIC_TRIAL_UNCHECKED), (2, PUBLIC_TRIAL_PUBLIC), (3, PUBLIC_TRIAL_PRIVATE), ) grok.global_utility(utils.create_restricted_vocabulary( IClassification['public_trial'], PUBLIC_TRIAL_OPTIONS, message_factory=_), provides=schema.interfaces.IVocabularyFactory, name=u'classification_public_trial_vocabulary')
grok.global_utility( utils.create_restricted_vocabulary( ILifeCycle['retention_period'], _get_retention_period_options, message_factory=_, restricted=_is_retention_period_restricted), provides=schema.interfaces.IVocabularyFactory, name=u'lifecycle_retention_period_vocabulary') # Default value form.default_value(field=ILifeCycle['retention_period'])( utils.set_default_with_acquisition( field=ILifeCycle['retention_period'], default=5)) # Validator class CustodyPeriodValidator(IntGreaterEqualThanParentValidator): pass validator.WidgetValidatorDiscriminators( CustodyPeriodValidator, field=ILifeCycle['custody_period']) grok.global_adapter(CustodyPeriodValidator)
registry = getUtility(IRegistry) retention_period_settings = registry.forInterface(IRetentionPeriodRegister) return retention_period_settings.is_restricted grok.global_utility(utils.create_restricted_vocabulary( ILifeCycle['retention_period'], _get_retention_period_options, message_factory=_, restricted=_is_retention_period_restricted), provides=schema.interfaces.IVocabularyFactory, name=u'lifecycle_retention_period_vocabulary') # Default value form.default_value(field=ILifeCycle['retention_period'])( utils.set_default_with_acquisition(field=ILifeCycle['retention_period'], default=5)) # Validator class CustodyPeriodValidator(IntGreaterEqualThanParentValidator): pass validator.WidgetValidatorDiscriminators(CustodyPeriodValidator, field=ILifeCycle['custody_period']) grok.global_adapter(CustodyPeriodValidator) # ---------- CUSTODY PERIOD ----------- # Vocabulary