pythondjangodocumentationdocutils

How to generate documentation for a Class-based View?


In Django documentation there's a short info on how to document models, views and other files to make it easily available in the Django Admin. But it lacks info on how to do this for class-based views. Say I have simple DetailView:

class MyDetailView(DetailView):
    model = MyModel

I write something like:

class MyDetailView(DetailView):
   """
       Displays single :model:`myApp.MyModel` with all details.

       :template: `myApp/mymodel_detail.html`
    """
    model = MyModel

But this won't show as a doc text with references to models/templates. How should I do that?


Solution

  • Turns out it didn't display :template: due to the extra unecessary space after the colon.