Not the โperfect wayโ you described, but django.contrib.admindocs
For the โperfect wayโ, you can create a small template filter that returns the docstring of the model, and use this in your overloads, either admin / change_form.html and admin / change_list.html.
Correct me if I am wrong, but docstrings are not the perfect place for content to be localized.
If you have a small amount of text for each model for localization, for example, one or two sentences, here are a few considerations:
- A small portion of the text can be stored in a python variable.
- Python variable can be proxied by django.utils.translation.ugettext.
- The class may contain a python variable.
So, I would try something like:
from django.utils.translation import ugettext as _ class Foo(models.Model): help_text = _(u'Documentation of Foo model to localize')
source share