Content types

Content types allow you to provide custom schemas and content to your services.

Out-of-the-box, guillotina ships with simple Container, Folder and Item content types. The Container content type is the main content type to hold your data in. It is the starting point for applications and other things to operate within.

The Folder type allows someone to add items inside of it. Both types only have simple Dublin Core fields by default.

Defining content types

A content type consists of a class and optionally, a schema to define the custom fields you want your class to use.

A simple type will look like this::

from guillotina import configure
from guillotina.content import Folder
from guillotina.interfaces import IItem
from guillotina import schema

class IMySchema(IItem):
    foo = schema.Text()

class MyType(Folder):

This example creates a schema and assigns it to the MyType content type.



If your service modules are not imported at run-time, you may need to provide an additional scan call to get your services noticed by guillotina.

In your application file, you can simply provide a scan call like

from guillotina import configure
def includeme(root):