Django - How can I set/change the verbose name of Djangos User-Model attributes? -
i'm building website contains several languages.
therefore need set verbose names of attributes in model classes (with internationalizaton-helper). unfortunately don't find way change verbose names of user attributes...
and overwriting every single form isn't nice way it, right?
thanks help!
ron
it depends on need for. generally, verbose_name
used within context of admin. if that's need worry about, can create proxy model , make user admin use that:
from django.contrib.auth.models import user django.utils.translation import ugettext_lazy _ class customuser(user): class meta: proxy = true app_label = 'auth' verbose_name = _('my custom user')
then, in admin.py:
django.contrib.auth.admin import useradmin django.contrib.auth.models import user .models import customuser admin.site.unregister(user) admin.site.register(customuser, useradmin)
Comments
Post a Comment