Ticket #1408: django_admin_modules_description.diff

File django_admin_modules_description.diff, 1.7 KB (added by django@…, 19 years ago)

implement module description

  • db/models/options.py

     
    1212
    1313DEFAULT_NAMES = ('verbose_name', 'verbose_name_plural', 'db_table', 'ordering',
    1414                 'unique_together', 'permissions', 'get_latest_by',
    15                  'order_with_respect_to', 'app_label')
     15                 'order_with_respect_to', 'app_label', 'description')
    1616
    1717class Options:
    1818    def __init__(self, meta):
     
    3131        self.pk = None
    3232        self.has_auto_field = False
    3333        self.one_to_one_field = None
     34        self.description = None
    3435
    3536    def merge_meta(self):
    3637        meta_attrs = self.meta.__dict__
  • 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': opts.description,
    194195        'fields': fields,
    195196    }, context_instance=RequestContext(request))
    196197model_detail = staff_member_required(model_detail)
  • contrib/admin/templates/admin_doc/model_detail.html

     
    1515{% block content %}
    1616<div id="content-main">
    1717<h1>{{ summary }}</h1>
     18{% if description %}
     19<p>{{ description }}</p>
     20{% endif %}
    1821
    1922<div class="module">
    2023<table class="model">
Back to Top