示例#1
0
 def __init__(self, *args: Any, **kwargs: Any) -> None:
     kwargs["coerce"] = LocaleSelectField.coerce
     kwargs["choices"] = list(i18n.supported_app_locales())
     super().__init__(*args, **kwargs)
示例#2
0
    def iter_choices(self):
        if not self.flags.required:
            yield (None, None, self.data is None)

        for locale, label in i18n.supported_app_locales():
            yield (locale.language, label.capitalize(), locale == self.data)
示例#3
0
    def iter_choices(self):
        if not self.flags.required:
            yield (None, None, self.data is None)

        for locale, label in i18n.supported_app_locales():
            yield (locale.language, label.capitalize(), locale == self.data)
示例#4
0
 def __init__(self, *args, **kwargs):
     kwargs["coerce"] = LocaleSelectField.coerce
     kwargs["choices"] = [
         locale_info for locale_info in i18n.supported_app_locales()
     ]
     super().__init__(*args, **kwargs)
示例#5
0
 def __init__(self, *args, **kwargs):
     kwargs['coerce'] = LocaleSelectField.coerce
     kwargs['choices'] = (locale_info
                          for locale_info in i18n.supported_app_locales())
     super(LocaleSelectField, self).__init__(*args, **kwargs)
示例#6
0
 def __init__(self, *args, **kwargs):
     kwargs["coerce"] = LocaleSelectField.coerce
     kwargs["choices"] = [
         locale_info for locale_info in i18n.supported_app_locales()
     ]
     super(LocaleSelectField, self).__init__(*args, **kwargs)
示例#7
0
 def __init__(self, *args, **kwargs):
   kwargs['coerce'] = LocaleSelectField.coerce
   kwargs['choices'] = (locale_info
                        for locale_info in i18n.supported_app_locales())
   super(LocaleSelectField, self).__init__(*args, **kwargs)