Opened 12 years ago

Closed 12 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

Description

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

:model:`appname.ModelName`
:tag:`tagname`

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:2 by Łukasz Rekucki, 12 years ago

Resolution: duplicate
Status: newclosed

Marking as duplicate of mentioned ticket.

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