I use simple views in my project, and now my project begin to be bigger, I'm writing a sphinx doc and use objects docstrings with sphinx.ext.autodoc
for inclusion.
My trouble is: How to greatly format view's docstring ?
For example, I'm using:
def my_view(request):
"""
Do something depending of HTTP method.
In GET: Returns a page
IN POST: Make something and redirect
GET parameters:
GET['next'] : URL to redirect to after submit form
POST parameters:
POST['action'] : Action
"""
I'm self-asking if there is a better way to do this ? Is there any consensus about it ?
A few examples you can find here: https://docs.djangoproject.com/en/1.8/ref/contrib/admin/admindocs/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With