Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python-calendarweek
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Libraries
python-calendarweek
Commits
a5682958
Verified
Commit
a5682958
authored
5 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
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
!1
Convert enums to lists for Django choices
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
calendarweek/django.py
+4
-4
4 additions, 4 deletions
calendarweek/django.py
with
4 additions
and
4 deletions
calendarweek/django.py
+
4
−
4
View file @
a5682958
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment