Exemplo n.º 1
0
import flatland

from common import I18nString, CommonList, CommonInteger

_EUsubaction = flatland.Dict.of(
        I18nString.named('title')
            .using(label=u'Title'),
        I18nString.named('body')
            .using(label=u'Description'),
        CommonInteger.named('id'),
   )

_EUaction = flatland.Dict.of(
       I18nString.named('title')
            .using(label=u'Title'),
       I18nString.named('body')
            .using(label=u'Description'),
        CommonInteger.named('id'),
        CommonList.named('subactions').of(_EUsubaction),
   )


_EUTargetSchemaDefiniton = flatland.Dict.of(
        I18nString.named('title')
            .using(label=u'Title'),
        I18nString.named('body')
            .using(label=u'Description'),
        CommonInteger.named('id'),
        CommonList.named('actions').of(_EUaction),
   )
Exemplo n.º 2
0
from common import I18nString, CommonString, CommonEnum, CommonList, ListValue,\
                   GoalEnumValue, CommonI18nString, CommonInteger, EnumValue, \
                   RuntimeTargetsCommonList, RuntimeActionsCommonList, RuntimeListValue
from .refdata import goals, targets, mapping, indicator_data

_GoalSchemaDefinition = flatland.Dict.of(
            CommonString.named('short_title'),
            I18nString.named('title')
                .using(label=_(u'Title')),
            I18nString.named('description')
                .using(label=_(u"Description")),
            CommonString.named('id'),
        )

_IndicatorSchemaDefinition = flatland.Dict.with_properties(widget="tabel_form").of(
            CommonInteger.named('id')
                .with_properties(widget="hidden"),
            CommonI18nString.named('name')
                .using(label=_("Operational Indicator")),
            CommonI18nString.named('question')
                .using(label=_("Communication Question")),
            CommonEnum.named('goal')
                .valued(*sorted(goals.keys()))
                .using(label=_("Strategic Goal"))
                .with_properties(widget="select", value_labels=goals),
            CommonI18nString.named('head_indicator')
                .using(label=_("Headline Indicator")),
            CommonI18nString.named('sub_indicator')
                .using(label=_("Indicator Sub-topics")),
            CommonEnum.named('relevant_target')
                .including_validators(GoalEnumValue())
                .valued(*sorted(targets.keys()))