From 6a65b04fe3d445b8ceaea7b3a30da36c50ae5250 Mon Sep 17 00:00:00 2001 From: "J.-S. Caux" <J.S.Caux@uva.nl> Date: Sat, 24 Sep 2016 06:58:52 +0200 Subject: [PATCH] Enable auto documentation in admin --- SciPost_v1/settings.py | 1 + SciPost_v1/urls.py | 1 + scipost/models.py | 3 +++ 3 files changed, 5 insertions(+) diff --git a/SciPost_v1/settings.py b/SciPost_v1/settings.py index 3ae8271cf..7b8d9b8b0 100644 --- a/SciPost_v1/settings.py +++ b/SciPost_v1/settings.py @@ -58,6 +58,7 @@ os.environ['wsgi.url_scheme'] = 'https' INSTALLED_APPS = ( 'django.contrib.admin', + 'django.contrib.admindocs', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', diff --git a/SciPost_v1/urls.py b/SciPost_v1/urls.py index fdddfa098..2536fb1ad 100644 --- a/SciPost_v1/urls.py +++ b/SciPost_v1/urls.py @@ -17,6 +17,7 @@ from django.conf.urls import include, url from django.contrib import admin urlpatterns = [ + url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^', include('scipost.urls', namespace="scipost")), url(r'^contributor/', include('scipost.urls', namespace="scipost")), diff --git a/scipost/models.py b/scipost/models.py index 28caa4746..c12b89aee 100644 --- a/scipost/models.py +++ b/scipost/models.py @@ -248,6 +248,9 @@ class Contributor(models.Model): def public_info_as_table (self): + """ + Prints out all publicly-accessible info as a table. + """ template = Template(''' <table> <tr><td>Title: </td><td> </td><td>{{ title }}</td></tr> -- GitLab