Pyramid CMS concepts and architecture

Pyramid CMS concepts and architecture

Pyramid and TurboGears

Pyramid CMS is built on top of TurboGears2 framework (TG2 for short). As soon as TG2 is MVC-based, Pyramid is also a MVC application.

Pyramid and other CMSs

Some ideas are inspired by (or borrowed/stolen from) the Drupal.

Publication concept

The main entities are node, comment and attachment. Node is the main entity and each node can have multiple comments and attachmets.

A Node (well, I borrowed the idea from the wonderfull Drupal) is a generic ”publication unit“. Each node has some type (see below) and a unique id, and can be access via a path like /node/13, where 13 is a node's id, and /node/ is a base path for a NodeController (see below).

The Node entity

Each node has a:

  1. unique ID
  2. title
  3. content
  4. a reference to a parent node
  5. references to child nodes
  6. [TODO] references to related nodes
  7. references to comments, attachmets, etc.

That is, all nodes can be organized in a tree (or several trees)

Node is extendable via inheritance. In fact, Node is just a base class for more sophisticated entities, like Article, BlogPost or ForumPost. From the database point of view, inheritance used is polymorphic multi-table. That is, all the base preperties (that ones from the base class, Node) are stored in a one table, and the extended attributes of descendants in their own tables. This allows us to access all the nodes, articles, etc. in the same way, perform a search for nodes of any types that have some tags or a subsrting in a title, and, for example, have an Article with a ForumThread or a WikiPage or a Poll attached to it.

Each Node is ”authored” and ”versioned”.