Code

#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)

Attachments (0)

Change History (2)

comment:1 Changed 22 months ago by Mr_Dave

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

comment:2 Changed 21 months ago by lrekucki

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

Marking as duplicate of mentioned ticket.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.