Ticket #17599: 17599-draft.patch
File 17599-draft.patch, 2.0 KB (added by , 13 years ago) |
---|
-
django/contrib/admindocs/views.py
193 193 if model is None: 194 194 raise Http404(_("Model %(model_name)r not found in app %(app_label)r") % {'model_name': model_name, 'app_label': app_label}) 195 195 196 title, body, metadata = utils.parse_docstring(model.__doc__) 197 if title: 198 title = utils.parse_rst(title, 'model', _('model:') + model_name) 199 if body: 200 body = utils.parse_rst(body, 'model', _('model:') + model_name) 201 for key in metadata: 202 metadata[key] = utils.parse_rst(metadata[key], 'model', _('model:') + model_name) 203 196 204 opts = model._meta 197 205 198 206 # Gather fields/field descriptions. … … 265 273 return render_to_response('admin_doc/model_detail.html', { 266 274 'root_path': urlresolvers.reverse('admin:index'), 267 275 'name': '%s.%s' % (opts.app_label, opts.object_name), 268 'summary': _("Fields on %s objects") % opts.object_name, 269 'description': model.__doc__, 276 'heading': _("Fields on %s objects") % opts.object_name, 277 'summary': title, 278 'body': body, 279 'meta': metadata, 270 280 'fields': fields, 271 281 }, context_instance=RequestContext(request)) 272 282 -
django/contrib/admindocs/templates/admin_doc/model_detail.html
23 23 24 24 {% block content %} 25 25 <div id="content-main"> 26 <h1>{{ summary}}</h1>26 <h1>{{ name }}</h1> 27 27 28 {% if description %} 29 <p>{% filter linebreaksbr %}{% trans description %}{% endfilter %}</p> 30 {% endif %} 28 <h2>{% trans "Description" %}</h2> 31 29 30 <strong>{{ summary }}</strong> 31 32 {{ body }} 33 34 <h2>{% trans "Fields" %}</h2> 35 32 36 <div class="module"> 33 37 <table class="model"> 34 38 <thead>