# Path: lfc/utils/registration.py
# def register_template(name, path, children_columns=0, images_columns=0):
#     """Registers a template.
# 
#     **Parameters:**
# 
#     name
#         The name of the template.
# 
#     path
#         The path to the template file.
# 
#     children_columns
#         The amount of columns for sub pages. This can be used within templates
#         to structure children.
# 
#     images_columns
#         The amount of columns for images. This can be used within templates
#         to structure images.
#     """
#     try:
#         name = name._proxy____str_cast()
#     except AttributeError:
#         pass
#     try:
#         Template.objects.create(name=name, path=path,
#             children_columns=children_columns, images_columns=images_columns)
#     except IntegrityError:
#         pass


from portlets.utils import register_portlet
from lfc.utils.registration import register_template
from lfc_portlets.models import NavigationPortlet
from lfc_portlets.models import ContentPortlet
from lfc_portlets.models import RandomPortlet
from lfc_portlets.models import TextPortlet
# portlets imports

# lfc imports


def initialize():
    """Registers default portlets, templates and content types.
    """
    # Portlets
    register_portlet(NavigationPortlet, u"Navigation")
    register_portlet(ContentPortlet, u"Content")
    register_portlet(RandomPortlet, u"Random")
    register_portlet(TextPortlet, u"Text")

    # Register Templates
    register_template(name=u"Plain", path=u"lfc/templates/plain.html")
    register_template(name=u"Article", path=u"lfc/templates/article.html")

# Path: lfc/utils/registration.py
# def register_template(name, path, children_columns=0, images_columns=0):
#     """Registers a template.
# 
#     **Parameters:**
# 
#     name
#         The name of the template.
# 
#     path
#         The path to the template file.
# 
#     children_columns
#         The amount of columns for sub pages. This can be used within templates
#         to structure children.
# 
#     images_columns
#         The amount of columns for images. This can be used within templates
#         to structure images.
#     """
#     try:
#         name = name._proxy____str_cast()
#     except AttributeError:
#         pass
#     try:
#         Template.objects.create(name=name, path=path,
#             children_columns=children_columns, images_columns=images_columns)
#     except IntegrityError:
#         pass


# Path: lfc/utils/initialize.py
from portlets.utils import register_portlet
from lfc.utils.registration import register_template
from lfc_portlets.models import NavigationPortlet
from lfc_portlets.models import ContentPortlet
from lfc_portlets.models import RandomPortlet
from lfc_portlets.models import TextPortlet

# portlets imports

# lfc imports


def initialize():
    """Registers default portlets, templates and content types.
    """
    # Portlets
    register_portlet(NavigationPortlet, u"Navigation")
    register_portlet(ContentPortlet, u"Content")
    register_portlet(RandomPortlet, u"Random")
    register_portlet(TextPortlet, u"Text")

    # Register Templates
    register_template(name=u"Plain", path=u"lfc/templates/plain.html")
    register_template(name=u"Article", path=u"lfc/templates/article.html")

    register_template(name=u"Gallery", path=u"lfc/templates/gallery.html", images_columns=3)