Ticket #1408: django_admin_modules_description2.diff

File django_admin_modules_description2.diff, 1.1 KB (added by django@…, 19 years ago)

patch that uses docstrings

  • contrib/admin/views/doc.py

     
    191191    return render_to_response('admin_doc/model_detail', {
    192192        'name': '%s.%s' % (opts.app_label, opts.object_name),
    193193        'summary': "Fields on %s objects" % opts.object_name,
     194        'description': model.__doc__,
    194195        'fields': fields,
    195196    }, context_instance=RequestContext(request))
    196197model_detail = staff_member_required(model_detail)
  • contrib/admin/templates/admin_doc/model_detail.html

     
    1616<div id="content-main">
    1717<h1>{{ summary }}</h1>
    1818
     19{% if description %}
     20<p>{% filter escape|linebreaksbr %}{% trans description %}{% endfilter %}</p>
     21{% endif %}
     22
    1923<div class="module">
    2024<table class="model">
    2125<thead>
Back to Top