mirror of
https://github.com/Hopiu/django.git
synced 2026-04-24 08:44:48 +00:00
- 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 |
||
|---|---|---|
| .. | ||
| apps | ||
| conf | ||
| contrib | ||
| core | ||
| db | ||
| dispatch | ||
| forms | ||
| http | ||
| middleware | ||
| template | ||
| templatetags | ||
| test | ||
| urls | ||
| utils | ||
| views | ||
| __init__.py | ||
| __main__.py | ||
| shortcuts.py | ||