Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added django_website/apps/docs/parts/flatten_docs.py

git-svn-id: http://code.djangoproject.com/svn/djangoproject.com@1897 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 7bb829be85b7b57456eba6a0c9858975821327f7 1 parent 6db7ec8
adrian authored
Showing with 20 additions and 0 deletions.
  1. +20 −0 django_website/apps/docs/parts/flatten_docs.py
View
20 django_website/apps/docs/parts/flatten_docs.py
@@ -0,0 +1,20 @@
+"""
+Utility that converts all current Django documents to flat pages.
+
+We use this to flatten/freeze the current Django documentation for
+a particular version.
+"""
+
+from django.models.flatpages import flatpages
+from django.models.docs import documents
+
+for doc in documents.get_list():
+ f = flatpages.FlatPage(
+ url='/documentation/0_90/%s/' % doc.slug,
+ title='Documentation (version 0.90) | %s' % doc.title,
+ content='%s</div><div id="content-related" class="sidebar"><h2>Contents</h2>%s' % (doc.get_content(), doc.get_toc()),
+ enable_comments=False,
+ template_name='flatfiles/legacy_docs',
+ registration_required=False)
+ f.save()
+ f.set_sites([1])
Please sign in to comment.
Something went wrong with that request. Please try again.