Ejemplo n.º 1
0
    CommonDict.named("representing")
              .using(label=_(u"Representing"))
              .of(

        CountryField.named("country")
                    .using(label=_(u"Country represented"), optional=True),

        CommonEnum.named("region")
                  .valued(*refdata.sorted_regions)
                  .using(label=_(u"Region"))
                  .with_properties(value_labels=refdata.region),

        CommonString.named("organization")
                    .using(label=_(u"Organization represented")),

        CommonBoolean.named("organization_show")
                     .using(label=_(u"Show in address")),
    ),

    CommonDict.named("more_info")
              .using(label=_(u"Additional information"))
              .of(

        CommonString.named("text")
                    .using(label=u"")
                    .with_properties(widget="textarea",
                            css_class="span6"),

    ),
)

Ejemplo n.º 2
0
                             .of(

        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"),

        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)