Esempio n. 1
0
     .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()))
     .with_properties(widget="select", value_labels=targets, mapping=mapping)
     .using(label=_("Most Relevant Aichi Target")),
 CommonList.named('other_targets')
     .of(CommonString.named('other_targets'))
     .including_validators(ListValue())
     .using(label=_("Other Relevant Aichi Targets"))
     .with_properties(widget="list",
                      valid_values=targets.keys(),
                      value_labels=targets,
                      css_class="chzn-select",
                      multiple="multiple"),
 CommonI18nString.named('classification')
     .using(label=_("Operational Classification")),
 CommonI18nString.named('status')
     .with_properties(field_widget='edit_textarea')
     .using(label=_("Status of development")),
 CommonEnum.named('sensitivity')
     .including_validators(EnumValue())
     .valued(*sorted(indicator_data['sensitivity'].keys()))
     .with_properties(widget="select", value_labels=indicator_data['sensitivity'])
     .using(label=_("Sensitivity (can it be used to make assessment by 2015?)")),
 CommonList.named('scale')
Esempio n. 2
0
_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),
   )

class EUTarget(_EUTargetSchemaDefiniton):
    def __init__(self, init_target):
        eu_target = dict(init_target)
Esempio n. 3
0
import flatland

from common import I18nString, CommonString, CommonList, CommonInteger, I18nStringOptional

_subobj_list = CommonList.named('subobjs').with_properties(widget="hidden")

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

_ObjectiveSchemaDefinition = flatland.Dict.named("objective").with_properties(widget="edit").of(
            I18nString.named('title')
                .using(label=u'Title')
                .with_properties(css_class="span4"),
            I18nStringOptional.named('body')
                .using(label=u'Description')
                .with_properties(field_widget="edit_textarea",
                                 css_class="input-xlarge"),
            CommonInteger.named('id')
                .with_properties(widget="hidden"),
            _subobj_list,
            CommonList.named('actions').of(_action)
        )

_subobj_list.member_schema = _ObjectiveSchemaDefinition

class Objective(_ObjectiveSchemaDefinition):