Opened 8 years ago

Closed 10 months ago

#5405 closed New feature (fixed)

Support restructured text in model docstrings

Reported by: mattmcc Owned by: zanderle
Component: contrib.admindocs Version: master
Severity: Normal Keywords:
Cc: karld@…, andrew.tennikoff@…, tomas.ehrlich@…, gokmen@…, zanderle, 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 mattmcc 8 years ago.
5405-2.diff (2.1 KB) - added by Elvard 3 years ago.
Updated version
5405-view-detail.diff (454 bytes) - added by Elvard 3 years ago.

Download all attachments as: .zip

Change History (30)

Changed 8 years ago by mattmcc

comment:1 Changed 8 years ago by mattmcc

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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

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

  • Triage Stage changed from Unreviewed to Ready for checkin

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

comment:3 Changed 8 years ago by brosner

  • 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 7 years ago by programmerq

  • milestone set to 1.0

comment:5 Changed 7 years ago by ubernostrum

  • milestone changed from 1.0 to post-1.0
  • Triage Stage changed from Ready for checkin to Accepted
  • Version changed from newforms-admin to SVN

comment:6 Changed 7 years ago by karld

  • Cc karld@… added

comment:7 Changed 7 years ago by anonymous

  • Cc andrew.tennikoff@… added

comment:8 Changed 7 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:9 Changed 4 years ago by gabrielhurley

  • Severity set to Normal
  • Type set to New feature

comment:10 Changed 4 years ago by julien

  • Easy pickings unset
  • Needs tests set

comment:11 Changed 4 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:12 Changed 3 years ago by lrekucki

  • Easy pickings set
  • Patch needs improvement set

Duplicated by #19062.

comment:13 Changed 3 years ago by Elvard

  • Cc tomas.ehrlich@… added
  • Component changed from contrib.admin to contrib.admindocs

comment:14 Changed 3 years ago by Elvard

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

Changed 3 years ago by Elvard

Updated version

Changed 3 years ago by Elvard

comment:15 Changed 3 years ago by Elvard

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 3 years ago by Elvard

  • Patch needs improvement unset

comment:18 Changed 3 years ago by gokmen

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

i need to review to improve tests.

comment:19 Changed 3 years ago by gokmen

  • Cc gokmen@… added
  • Keywords sprint2013 added
  • Owner changed from nobody to gokmen
  • Status changed from new to assigned

comment:20 Changed 2 years ago by timo

  • 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 23 months ago by timo

  • Easy pickings unset

comment:22 Changed 17 months ago by aaugustin

#22428 was a duplicate with a patch.

comment:23 Changed 10 months ago by zanderle

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

comment:24 Changed 10 months ago by zanderle

  • Cc zanderle added
  • Owner changed from gokmen to zanderle

comment:26 Changed 10 months ago by MarkusH

  • Cc info+coding@… added
  • Keywords nfa-someday sprint2013 removed
  • Needs documentation unset
  • Patch needs improvement unset
  • Triage Stage changed from Accepted to Ready for checkin

The patch looks good to me.

comment:27 Changed 10 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

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