Opened 17 years ago

Closed 10 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: dev
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 17 years ago.
5405-2.diff (2.1 KB ) - added by Tomáš Ehrlich 12 years ago.
Updated version
5405-view-detail.diff (454 bytes ) - added by Tomáš Ehrlich 12 years ago.

Download all attachments as: .zip

Change History (30)

by Matt McClanahan, 17 years ago

Attachment: 5405-1.diff added

comment:1 by Matt McClanahan, 17 years ago

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 by Simon G. <dev@…>, 17 years ago

Triage Stage: UnreviewedReady for checkin

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

comment:3 by Brian Rosner, 17 years ago

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 by Jeff Anderson, 16 years ago

milestone: 1.0

comment:5 by James Bennett, 16 years ago

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

comment:6 by karld, 16 years ago

Cc: karld@… added

comment:7 by anonymous, 16 years ago

Cc: andrew.tennikoff@… added

comment:8 by (none), 16 years ago

milestone: post-1.0

Milestone post-1.0 deleted

comment:9 by Gabriel Hurley, 14 years ago

Severity: Normal
Type: New feature

comment:10 by Julien Phalip, 14 years ago

Easy pickings: unset
Needs tests: set

comment:11 by Aymeric Augustin, 13 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:12 by Łukasz Rekucki, 12 years ago

Easy pickings: set
Patch needs improvement: set

Duplicated by #19062.

comment:13 by Tomáš Ehrlich, 12 years ago

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

comment:14 by Tomáš Ehrlich, 12 years ago

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

by Tomáš Ehrlich, 12 years ago

Attachment: 5405-2.diff added

Updated version

by Tomáš Ehrlich, 12 years ago

Attachment: 5405-view-detail.diff added

comment:15 by Tomáš Ehrlich, 12 years ago

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 by Tomáš Ehrlich, 12 years ago

Patch needs improvement: unset

comment:18 by Gökmen Görgen, 12 years ago

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

i need to review to improve tests.

comment:19 by Gökmen Görgen, 12 years ago

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

comment:20 by Tim Graham, 11 years ago

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 by Tim Graham, 11 years ago

Easy pickings: unset

comment:22 by Aymeric Augustin, 11 years ago

#22428 was a duplicate with a patch.

comment:23 by Žan Anderle, 10 years ago

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

comment:24 by Žan Anderle, 10 years ago

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

comment:26 by Markus Holtermann, 10 years ago

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 by Tim Graham <timograham@…>, 10 years ago

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