Opened 3 years ago

Closed 3 years ago

#19062 closed Bug (duplicate)

reST Markup not supported for docstrings on the model detail.

Reported by: Mr_Dave Owned by: nobody
Component: contrib.admindocs Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


reST Markup is supported when rendering docstrings as documentation in the admindocs app. According to the list of supported Django Component reST roles, markup such as


should be rendered in admindocs as a hyperlink to the admindoc page for the specified component.

It appears that this isn't supported for docstrings that are rendered as model descriptions. From the view:

    return render_to_response('admin_doc/model_detail.html', {
        'root_path': urlresolvers.reverse('admin:index'),
        'name': '%s.%s' % (opts.app_label, opts.object_name),
        'summary': _("Fields on %s objects") % opts.object_name,
        'description': model.__doc__,
        'fields': fields,
    }, context_instance=RequestContext(request))

Instead of returning model.__doc__ as description, this needs to parsed for reST.

    model_description = utils.parse_rst(model.__doc__, 'model', _('model:') + opts.module_name)

Change History (2)

comment:1 Changed 3 years ago by Mr_Dave

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 3 years ago by lrekucki

  • Resolution set to duplicate
  • Status changed from new to closed

Marking as duplicate of mentioned ticket.

Note: See TracTickets for help on using tickets.
Back to Top