CommonString.named("iso") \
                    .using(label=u"ISO", optional=False) \
                    .with_properties(css_class="input-big"),

        CommonString.named("en") \
                    .using(label="English name", optional=False),

        CommonString.named("es") \
                    .using(label="Spanish name"),

        CommonString.named("fr") \
                    .using(label="French name"),

        CommonEnum.named("region") \
                  .valued(*sorted(countries_regions.keys())) \
                  .with_properties(value_labels=countries_regions) \
                  .using(label=u"Region", optional=False),

        fl.Dict.named('date1') \
               .using(label='Date 1', optional=True) \
               .with_properties(widget="inline_dict") \
               .of(

            CommonDate.named("date") \
                      .using(label=u"Date"),

            CommonEnum.named("date_type") \
                      .using(label=u"Type") \
                      .valued(*sorted(countries_date1_types.keys())) \
                      .with_properties(value_labels=countries_date1_types,
                                       css_class="input-big"),
Exemple #2
0
                    .with_properties(css_class="input-big"),

        CommonString.named("en") \
                    .using(label="English name", optional=False),

        CommonString.named("es") \
                    .using(label="Spanish name"),

        CommonString.named("fr") \
                    .using(label="French name"),

        CommonBoolean.named("request_funding") \
                    .using(label="Request funding", default=True),

        CommonEnum.named("region") \
                  .valued(*sorted(countries_regions.keys())) \
                  .with_properties(value_labels=countries_regions) \
                  .using(label=u"Region", optional=False),
)


class CountrySchema(_CountrySchemaDefinition):

    regions = countries_regions

    @property
    def value(self):
        return CountrySchema(super(CountrySchema, self).value)


class Country():
Exemple #3
0
                .with_properties(widget="hide"),

    CommonString.named("token")
                 .using(label="", optional=True)
                 .with_properties(widget="hide"),

    CommonString.named("photo")
                 .using(label="", optional=True)
                 .with_properties(widget="hide"),

    CommonDict.named("personal")
              .using(label="")
              .of(

        CommonEnum.named("name_title")
                    .valued(*sorted(refdata.personal_title.keys()))
                    .using(label=_(u"Personal title"))
                    .with_properties(attr={"autofocus": ""}),

        CommonString.named("first_name")
                    .using(optional=False,
                           label=_(u"Given name")),

        CommonString.named("last_name")
                    .using(optional=False,
                           label=_(u"Family name")),

        CommonString.named("badge_name")
                    .using(optional=True, label=_(u"Name on the badge")),

        CommonEnum.named("language")
                  .valued(*sorted(refdata.language.keys()))
Exemple #4
0
            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()))
                .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",