News

This document describes the functionality of the News application, which represents the core news types including Section, Issue and Article.

Display Types

class models.ArticleDisplayType
class models.IssueDisplayType

Display types are a means of defining multiple templates to display a given type of content. Not all Issues or Articles are alike, and some may require different template designs and styles. Instead of defining new content types to handle these situations, it is rather preferrable to just create a new display type to handle the new designs.

models.ArticleDisplayType.name
models.IssueDisplayType.name
A simple identifier.
models.ArticleDisplayType.template_name
models.IssueDisplayType.template_name
The name of the template (without file extension) that should be used to render content objects with this DisplayType. Should include the relative path from the site template directory (e.g., “issues/standard” or “articles/types/big_picture”).

Sections

class models.Section

Sections represent the primary method of segmenting site content, and are analogous to the sections in a print publication. Unlike a print section, however, Sections can be nested within each other, resulting in a hierarchical, tree-like structure.

models.Section.name
A simple identifier, such as “News” or “Sports.”
models.Section.parent
Optional. Another Section which contains this Section. Used to create subsections.
models.Section.path
A URL-friendly path string, relative to the parent‘s full path.
models.Section.full_path
The full, absolute, URL-friendly path for this Section. Should not be modified directly, as it will be updated on save() based on the value of path and parent.full_path.

Issues

class models.Issue

Issues are an optional container type used to group content items published on the same date. This is most useful for sites which have corresponding print publications.

models.Issue.name
A simple identifier to make tracking of issues easier. Can generally be set to a human-readable form of the publication date.
models.Issue.published
A flag denoting whether this Issue should be accessible on the public- facing site. Will eventually be replaced by the new admin workflow system.
models.Issue.published_at
The date and time at which the Issue was/will be published.
models.Issue.display_type
The IssueDisplayType that should be used to render this Issue.
models.Issue.lead_media
An optional link to a MediaItem that is the lead/primary/headline media item for this issue. It is up to the display_type to render this appropriately.
models.Issue.articles
The collection of Articles in this Issue.

Articles

Articles are the heart of a news site, and represent the actual textual news content.

Statuses

class models.ArticleStatus

A status value that can be assigned to an Article. Useful for handling newsroom workflow, and used to determine which articles are visible on the public-facing website. Will eventually be superceded by new admin workflow system.

models.ArticleStatus.name
A simple identifier.
models.ArticleStatus.published
A flag denoting whether Articles with this status should be visible on the public-facing website.

Default Article Model

class models.Article

Courant News ships with a “default” Article model, which is supposed to represent a lowest-common-denominator set of information. Because each news organization has different needs when it comes to information associated with articles, it is possible to create custom Article-derived models (see below).

Note

Article model attribute breakdown coming soon.

Custom Article Types

The Article model can take advantage of the dynamic type system to create custom article types. Please read the dynamic type documentation.

Table Of Contents

This Page