Skip to content

Conversation

@flaeppe
Copy link
Member

@flaeppe flaeppe commented Nov 19, 2022

I have made things!

Quite a bit far down into ModelAdmin.fieldsets, the "description" value should support being gettext_lazy

i.e. the following should type check

from django.utils.translation import gettext_lazy
...


class MyModelAdmin(ModelAdmin):
    fieldsets = (
        (
            gettext_lazy("group 1 header"),
            {"description": gettext_lazy("description"), "fields": ("f1", "f2")},
        ),
        (
            gettext_lazy("group 2 header"),
            {"fields": ("f3", "f4")},
        ),
    )

Related issues

None

@sobolevn sobolevn merged commit fa972f1 into typeddjango:master Nov 19, 2022
@sobolevn
Copy link
Member

Thanks!

@flaeppe flaeppe deleted the fix/admin-fieldsets branch November 20, 2022 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants