django/django
Nick Pope fe19b33e2f Modernized enumeration helpers on Python 3.11+.
- use @enum.property

https://docs.python.org/3/library/enum.html#enum.property

- use @enum.nonmember

Using @property on an enum class does not yield the expected result.
do_not_call_in_templates attribute works because a @property instance
is truthy. We can make this a literal True value as expected by using
@enum.nonmember in Python 3.11+.

https://docs.python.org/3/library/enum.html#enum.nonmember

- used enum.IntEnum/StrEnum

Python 3.11+ has ReprEnum which uses int.__str__() and str.__str__()
for __str__() in the `IntEnum` and `StrEnum` subclasses. We can emulate
that for Python < 3.11.

https://docs.python.org/3/library/enum.html#enum.ReprEnum
https://docs.python.org/3/library/enum.html#enum.IntEnum
https://docs.python.org/3/library/enum.html#enum.StrEnum
2023-09-13 08:30:21 +02:00
..
apps Fixed #34687 -- Made Apps.clear_cache() clear get_swappable_settings_name() cache. 2023-06-30 08:27:15 +02:00
conf Fixed #34821 -- Prevented DEFAULT_FILE_STORAGE/STATICFILES_STORAGE settings from mutating the main STORAGES. 2023-09-11 13:04:32 +02:00
contrib Fixed #34816 -- Fixed GenericForeignKey crash when checking cache for primary keys with different types. 2023-09-08 08:47:11 +02:00
core Fixed #34752 -- Fixed handling ASGI http.disconnect for streaming responses. 2023-09-11 19:53:21 +02:00
db Modernized enumeration helpers on Python 3.11+. 2023-09-13 08:30:21 +02:00
dispatch Fixed #32172 -- Adapted signals to allow async handlers. 2023-03-07 08:39:25 +01:00
forms Refs #31262 -- Renamed ChoiceIterator to BaseChoiceIterator. 2023-09-04 13:56:50 +02:00
http Fixed #34709 -- Raised BadRequest for non-UTF-8 requests with the application/x-www-form-urlencoded content type. 2023-08-25 21:27:22 +02:00
middleware Fixed #34515 -- Made LocaleMiddleware prefer language from paths when i18n patterns are used. 2023-05-02 06:04:18 +02:00
template Fixed #34692 -- Made autoreloader reset cached template loader for default renderer. 2023-08-09 09:09:52 +02:00
templatetags Refs #34233 -- Used str.removeprefix()/removesuffix(). 2023-01-18 19:11:18 +01:00
test Fixed #34210 -- Added unittest's durations option to the test runner. 2023-08-31 07:14:58 +02:00
urls Refs #34691 -- Optimized system check for unmatched angle brackets in path(). 2023-07-11 22:45:31 +02:00
utils Renamed ChoicesMeta to ChoicesType. 2023-09-12 11:51:01 +02:00
views Refs #31949 -- Made @vary_on_(cookie/headers) decorators work with async functions. 2023-07-10 11:43:36 +02:00
__init__.py Bumped version; master is now 5.0 pre-alpha. 2023-01-17 11:49:15 +01:00
__main__.py Fixed #24857 -- Added "python -m django" entry point. 2015-09-07 19:54:32 -04:00
shortcuts.py Fixed #34714 -- Added aget_object_or_404()/aget_list_or_404() shortcuts. 2023-07-24 07:37:54 +02:00