Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type ModelAdmin.fieldsets 'description' option to support gettext_lazy #1268

Merged
merged 1 commit into from
Nov 19, 2022

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