views:

68

answers:

1

Hi all,

I am using ugettext to translate a Category model's verbose_name. This works fine in admin when adding new objects, however, when using Category as in a one-to-many relationship with Post, the Category's verbose_name is neither translated in the list filter nor the change form of Post.

How can I correct this?

A: 

I just checked the official docs on Verbose field names. ForeignKey does not not accept the verbose_name positional argument.

I think what fviktor tried to suggest was to set the verbose_name attribute in your model's Meta class:

class Category(Model):
    class Meta:
        verbose_name = _lazy(u'Category')
        verbose_name_plural = _lazy(u'Categories')
kRON
Thank you, that did it: Passing verbose_name=_('Category') keyword argument when adding the ForeignKey field.
Sam