newbie programmer
newbie programmer

Reputation: 317

How to alter label tag of fieldset in django admin page using admin.tabularinline

I customized my add user form in my django admin, using admin.tabularinline. So whenever the admin adds a user, information about Usermodel and UserProfile model is saved at the same time. However, the label tag of the UserProfile form says 'Staff Profiles'(with 's'). And it doesn't look good because there is only one profile for one user. Any ideas how to change the "Staff Profiles" into "Staff Profile"? See the picture for reference:

enter image description here

Upvotes: 0

Views: 430

Answers (1)

Julien Kieffer
Julien Kieffer

Reputation: 1145

As specified in docs, changing your verbose_name_plural in UserProfileInline

In admin declaration, add

class UserProfileInline(admin.YourInlineChoice):
    verbose_name_plural="Staff Profile"
    [Your params]

Upvotes: 1

Related Questions