Code

Models

Models used to store web pages.

class dmcm.cm.models.BlogPage(*args, **kwargs)

Page information for a blog entry.

Fields:
date : date

Date of blog entry.

title : char

Title of blog entry.

filename : char

Name of HTML and TXT files to which blog entry is written.

updated : date_time

When blog entry was last updated.

body_markdown : text

Blog entry body in markdown format.

body : text

Blog entry body in html format.

save()
Convert markdown text into HTML and save blog entry.
class dmcm.cm.models.List(*args, **kwargs)

List information.

A list is a more structured form of page. Its body is generated from prefix and suffix text combined with cardgen output from a template and list of data items.

Fields:
title : char

Title of list.

parent : foreign_key on page

Parent page in site structure.

updated : date_time

When page was last updated.

prefix : char

First part of list.

template : char

Structure of a single item on list.

delimiter : char

Delimiter used to separate items in the data.

data : text

Data items separated by delimiters.

suffix : char

Last part of list.

list_body : text

List body in html format.

save()
Generate list from template and data. Combine results with prefix and suffix to create list_body.
class dmcm.cm.models.Option(*args, **kwargs)

Application Options.

Fields:
deploy_path : char

Fully qualified path to which directory html files are written when published.

source_dir : char

Name of directory within deployment directory to which markup source is written.

nav_menu_body : text

Html of site navigation menu.

page_template : text

Django template used to build site html files.

root_page : 1-to-1 foreign_key

Topmost page in site tree-structure.

sitemap_list : 1-to-1 foreign_key

List containing automatically generated site structure.

blog_root_page : 1-to-1 foreign_key

Topmost page of blog.

blog_summary_size : int

Number of blog entries to include on blog_root_page.

blog_deploy_dir: char

Directory to which blog html files are written when published.

blog_source_dir : char

Name of directory within blog deployment directory to which markup source is written. sitemap_list : 1-to-1 foreign_key

class dmcm.cm.models.Page(*args, **kwargs)

Page information.

Fields:
title : char

Title of page.

dirname : char

Name of directory to which HTML file is written.

filename : char

Name of HTML and TXT files to which page is written.

parent : foreign_key on page

Parent page in site structure.

updated : date_time

When page was last updated.

body_markdown : text

Page body in markdown format.

body : text

Page body in html format.

save()
Convert markdown text into HTML and save page.

Views

dmcm.cm.views.blog_add(request, *args, **kwargs)

Add blog entry.

Display form to add blog entry details.

Save entered data.

dmcm.cm.views.blog_update(request, *args, **kwargs)

Edit blog entry.

Parameters:
blog_page_id : int

Current blog entry.

Display form with current blog entry details to be amended.

Save entered data.

dmcm.cm.views.generate_site_map()
Generate Site Map from pages of site.
dmcm.cm.views.home(request, *args, **kwargs)
Show Blog Entries, Pages and Lists which make up site.
dmcm.cm.views.list_add(request, *args, **kwargs)

Add List.

Display form to enter list details.

Save entered data.

dmcm.cm.views.list_update(request, *args, **kwargs)

Edit List.

Parameters:
list_id : int

Current list.

Display form with current list details to be amended.

Save entered data.

dmcm.cm.views.options(request, *args, **kwargs)
Update Options.
dmcm.cm.views.page_add(request, *args, **kwargs)

Add Page.

Display form to enter page details.

Save entered data.

dmcm.cm.views.page_update(request, *args, **kwargs)

Edit Page.

Parameters:
page_id : int

Current page.

Display form with current page details to be amended.

Save entered data.

dmcm.cm.views.publish_all()
Write all pages out as .html and .txt files.
dmcm.cm.views.publish_blog(blog_page)
Write blog entry out as .html and .txt files.
dmcm.cm.views.publish_blog_summary(ftp_serv)

Write recent blog entries out in a .html file.

Also write .rss file for all entries.

dmcm.cm.views.publish_page(page)
Write page out as .html and .txt files.

Forms

class dmcm.cm.forms.BlogPageForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.util.ErrorList'>, label_suffix=':', empty_permitted=False, instance=None)

Add/Update blog entry contents.

Fields:

date : date

title : char

filename : char

body_markdown : text

Blog entry entered in markdown format.

class dmcm.cm.forms.ListForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.util.ErrorList'>, label_suffix=':', empty_permitted=False, instance=None)

Add/Update List contents.

Fields:

title : text

parent : Choose any Page

Choice field based on entries in Page model.

prefix : text

Text before List contents, entered in Markdown format.

template : text

Structure of List contents.

delimiter : text

Separator of fields on each line of data.

data : text

List contents, fields separated by delimiters.

suffix : text

Text after List contents, entered in Markdown format.

class dmcm.cm.forms.OptionForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.util.ErrorList'>, label_suffix=':', empty_permitted=False, instance=None)
Update Options.
class dmcm.cm.forms.PageForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.util.ErrorList'>, label_suffix=':', empty_permitted=False, instance=None)

Add/Update Page contents.

Fields:

title : text

dirname : text

filename : text

parent : Choose any Page

Choice field based on entries in Page model.

body_markdown : text

Page contents entered in Markdown format.

Table Of Contents

Previous topic

Install

This Page