Opened 9 years ago

Closed 2 years ago

#5405 closed New feature (fixed)

Support restructured text in model docstrings

Reported by: Matt McClanahan Owned by: Žan Anderle
Component: contrib.admindocs Version: master
Severity: Normal Keywords:
Cc: karld@…, andrew.tennikoff@…, tomas.ehrlich@…, gokmen@…, Žan Anderle, info+coding@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It'd be nice to be able to use ReST in the docstrings of models. The admindocs views currently parse ReST for template tags, filters, and views, but not models.

Attachments (3)

5405-1.diff (2.0 KB) - added by Matt McClanahan 9 years ago.
5405-2.diff (2.1 KB) - added by Tomáš Ehrlich 4 years ago.
Updated version
5405-view-detail.diff (454 bytes) - added by Tomáš Ehrlich 4 years ago.

Download all attachments as: .zip

Change History (30)

Changed 9 years ago by Matt McClanahan

Attachment: 5405-1.diff added

comment:1 Changed 9 years ago by Matt McClanahan

Has patch: set

There's a possibility that this patch breaks backwards compatibility if a user overrides the admin_doc/model_detail.html template.

comment:2 Changed 9 years ago by Simon G. <dev@…>

Triage Stage: UnreviewedReady for checkin

Since the other things in admin_docs support rst, then we should be consistent.

comment:3 Changed 9 years ago by Brian Rosner

Keywords: nfa-someday added

This ticket isn't critical for merging newforms-admin into trunk. Tagging with nfa-someday. Looks like this would be a good improvement and make things consistent.

comment:4 Changed 8 years ago by Jeff Anderson

milestone: 1.0

comment:5 Changed 8 years ago by James Bennett

milestone: 1.0post-1.0
Triage Stage: Ready for checkinAccepted
Version: newforms-adminSVN

comment:6 Changed 8 years ago by karld

Cc: karld@… added

comment:7 Changed 8 years ago by anonymous

Cc: andrew.tennikoff@… added

comment:8 Changed 8 years ago by (none)

milestone: post-1.0

Milestone post-1.0 deleted

comment:9 Changed 6 years ago by Gabriel Hurley

Severity: Normal
Type: New feature

comment:10 Changed 6 years ago by Julien Phalip

Easy pickings: unset
Needs tests: set

comment:11 Changed 5 years ago by Aymeric Augustin

UI/UX: unset

Change UI/UX from NULL to False.

comment:12 Changed 4 years ago by Łukasz Rekucki

Easy pickings: set
Patch needs improvement: set

Duplicated by #19062.

comment:13 Changed 4 years ago by Tomáš Ehrlich

Cc: tomas.ehrlich@… added
Component: contrib.admincontrib.admindocs

comment:14 Changed 4 years ago by Tomáš Ehrlich

Also duplicated by #17599 which has very similar patch. I'll post updated version soon.

Changed 4 years ago by Tomáš Ehrlich

Attachment: 5405-2.diff added

Updated version

Changed 4 years ago by Tomáš Ehrlich

Attachment: 5405-view-detail.diff added

comment:15 Changed 4 years ago by Tomáš Ehrlich

Patch updated, but I'm not sure how to write tests. There're no similar tests in django.contrib.admindocs.tests. I renamed body in original patch to description to keep the backward compatibility (in case someone has it's own version of model_detail.html).

Also, the ticket #17599 is talking about model_detail only, but there's another misleading information in docs, about using :model: reference in view function. It didn't work for me and I've found there's a striptags filter, which strips all generated links. It's included in the second patch.

comment:17 Changed 4 years ago by Tomáš Ehrlich

Patch needs improvement: unset

comment:18 Changed 4 years ago by Gökmen Görgen

https://github.com/django/django/pull/760

i need to review to improve tests.

comment:19 Changed 4 years ago by Gökmen Görgen

Cc: gokmen@… added
Keywords: sprint2013 added
Owner: changed from nobody to Gökmen Görgen
Status: newassigned

comment:20 Changed 3 years ago by Tim Graham

Needs documentation: set
Needs tests: unset
Patch needs improvement: set

I left comments on the pull request but it still needs some improvement including a rebase to merge cleanly. It would also be good to mention the change in the release notes.

comment:21 Changed 3 years ago by Tim Graham

Easy pickings: unset

comment:22 Changed 3 years ago by Aymeric Augustin

#22428 was a duplicate with a patch.

comment:23 Changed 2 years ago by Žan Anderle

gokmen, are you still working on this? Otherwise, I'll give it a shot

comment:24 Changed 2 years ago by Žan Anderle

Cc: Žan Anderle added
Owner: changed from Gökmen Görgen to Žan Anderle

comment:26 Changed 2 years ago by Markus Holtermann

Cc: info+coding@… added
Keywords: nfa-someday sprint2013 removed
Needs documentation: unset
Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

The patch looks good to me.

comment:27 Changed 2 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 7b420367524ad9f29b8bf0284f4b40bd6cfc8b93:

Fixed #5405 -- Added admindocs support for reStructured text in model docstrings

Thanks elvard and gkmngrgn for work on the patch and Markus H. for review.

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