Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)