mfogel / django-timezone-field

A Django app providing DB, form, and REST framework fields for zoneinfo and pytz timezone objects.
BSD 2-Clause "Simplified" License
397 stars 95 forks source link

Use zoneinfo.available_timezones() #108

Closed mfogel closed 1 year ago

mfogel commented 1 year ago

This MR configures the packages so that when using this with use_pytz=False:

It accomplishes this by introducing the concept of a "timezone backend", and includes a pytz backend and a zoneinfo backend.

Closes #98

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 95.83% and project coverage change: -1.95% :warning:

Comparison is base (069c302) 100.00% compared to head (5a4c69d) 98.05%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #108 +/- ## =========================================== - Coverage 100.00% 98.05% -1.95% =========================================== Files 7 9 +2 Lines 201 206 +5 =========================================== + Hits 201 202 +1 - Misses 0 4 +4 ``` | [Files Changed](https://app.codecov.io/gh/mfogel/django-timezone-field/pull/108?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Mike+Fogel) | Coverage Δ | | |---|---|---| | [timezone\_field/backends/base.py](https://app.codecov.io/gh/mfogel/django-timezone-field/pull/108?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Mike+Fogel#diff-dGltZXpvbmVfZmllbGQvYmFja2VuZHMvYmFzZS5weQ==) | `84.61% <84.61%> (ø)` | | | [timezone\_field/backends/pytz.py](https://app.codecov.io/gh/mfogel/django-timezone-field/pull/108?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Mike+Fogel#diff-dGltZXpvbmVfZmllbGQvYmFja2VuZHMvcHl0ei5weQ==) | `92.30% <92.30%> (ø)` | | | [timezone\_field/backends/zoneinfo.py](https://app.codecov.io/gh/mfogel/django-timezone-field/pull/108?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Mike+Fogel#diff-dGltZXpvbmVfZmllbGQvYmFja2VuZHMvem9uZWluZm8ucHk=) | `94.44% <94.44%> (ø)` | | | [timezone\_field/backends/\_\_init\_\_.py](https://app.codecov.io/gh/mfogel/django-timezone-field/pull/108?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Mike+Fogel#diff-dGltZXpvbmVfZmllbGQvYmFja2VuZHMvX19pbml0X18ucHk=) | `100.00% <100.00%> (ø)` | | | [timezone\_field/choices.py](https://app.codecov.io/gh/mfogel/django-timezone-field/pull/108?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Mike+Fogel#diff-dGltZXpvbmVfZmllbGQvY2hvaWNlcy5weQ==) | `100.00% <100.00%> (ø)` | | | [timezone\_field/fields.py](https://app.codecov.io/gh/mfogel/django-timezone-field/pull/108?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Mike+Fogel#diff-dGltZXpvbmVfZmllbGQvZmllbGRzLnB5) | `100.00% <100.00%> (ø)` | | | [timezone\_field/forms.py](https://app.codecov.io/gh/mfogel/django-timezone-field/pull/108?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Mike+Fogel#diff-dGltZXpvbmVfZmllbGQvZm9ybXMucHk=) | `100.00% <100.00%> (ø)` | | | [timezone\_field/rest\_framework.py](https://app.codecov.io/gh/mfogel/django-timezone-field/pull/108?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Mike+Fogel#diff-dGltZXpvbmVfZmllbGQvcmVzdF9mcmFtZXdvcmsucHk=) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.