Skip to content
Snippets Groups Projects
Verified Commit a5682958 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Convert enums to lists for Django choices

Makes using in Django templates easier
parent 15d79f59
No related branches found
No related tags found
1 merge request!1Convert enums to lists for Django choices
......@@ -61,25 +61,25 @@ def i18n_month_abbrs(loc: Optional[str] = None) -> Tuple[str]:
def i18n_day_name_choices(loc: Optional[str] = None) -> Tuple[Tuple[int, str]]:
""" Return an enumeration of day names for the current locale. """
return enumerate(i18n_day_names(loc))
return list(enumerate(i18n_day_names(loc)))
def i18n_day_abbr_choices(loc: Optional[str] = None) -> Tuple[Tuple[int, str]]:
""" Return an enumeration of day name abbreviations for the current locale. """
return enumerate(i18n_day_abbrs(loc))
return list(enumerate(i18n_day_abbrs(loc)))
def i18n_month_name_choices(loc: Optional[str] = None) -> Tuple[Tuple[int, str]]:
""" Return an enumeration of month names for the current locale. """
return enumerate(i18n_month_names(loc))
return list(enumerate(i18n_month_names(loc)))
def i18n_month_abbr_choices(loc: Optional[str] = None) -> Tuple[Tuple[int, str]]:
""" Return an enumeration of month name abbreviations for the current locale. """
return enumerate(i18n_month_abbrs(loc))
return list(enumerate(i18n_month_abbrs(loc)))
def i18n_js(request: HttpRequest) -> HttpResponse:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment