import functools
def fizzbuzz(n):
if not n % 3: yield (r := "fizz")
if not n % 5: yield (r := "buzz")
if not "r" in locals(): yield n
compose = lambda f, g: lambda *args: f(g(*args))
functions = "".join, functools.partial(map, str), fizzbuzz
transform = functools.reduce(compose, functions)
print("\n".join(map(transform, range(1, 100)))) git init -q && git commit -q --allow-empty -m "Hello, World\!" && git show --format=%B | head -1
You still depend on a database with the `Task` model. This would be a no-go for that reason, since there's no reasonable way to have an impact on its behaviour, outside of creating a custom database router to avoid having every third-party library hitting the same database as core logic.
If you absolutely must use a model, take a look at enumeration types[1] for a slightly "neater" way to declare choices.
[1]: https://docs.djangoproject.com/en/4.1/ref/models/fields/#enu...