From b830fa7e7896bc7e13254740b12ec5ab7eed82cf Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Mon, 27 Feb 2006 21:05:50 +0000 Subject: [PATCH] Exposed model __doc__ in admin docs views which fixes #1408. Thanks, poelzi git-svn-id: http://code.djangoproject.com/svn/django/trunk@2417 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/admin/templates/admin_doc/model_detail.html | 4 ++++ django/contrib/admin/views/doc.py | 1 + 2 files changed, 5 insertions(+) diff --git a/django/contrib/admin/templates/admin_doc/model_detail.html b/django/contrib/admin/templates/admin_doc/model_detail.html index 31e5520aa0..0eb2971048 100644 --- a/django/contrib/admin/templates/admin_doc/model_detail.html +++ b/django/contrib/admin/templates/admin_doc/model_detail.html @@ -16,6 +16,10 @@

{{ summary }}

+{% if description %} +

{% filter escape|linebreaksbr %}{% trans description %}{% endfilter %}

+{% endif %} +
diff --git a/django/contrib/admin/views/doc.py b/django/contrib/admin/views/doc.py index 0545d49367..7888bb0471 100644 --- a/django/contrib/admin/views/doc.py +++ b/django/contrib/admin/views/doc.py @@ -185,6 +185,7 @@ def model_detail(request, model): return render_to_response('admin_doc/model_detail', { 'name': '%s.%s' % (opts.app_label, opts.module_name), 'summary': "Fields on %s objects" % opts.verbose_name, + 'description' : model.__doc__, 'fields': fields, }, context_instance=DjangoContext(request)) model_detail = staff_member_required(model_detail)