All pastes #353736 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-02-13 15:32 UTC
rendered paste body
freebsd# cat __init__.py
from Products.Archetypes.atapi import process_types, listTypes
from Products.CMFCore import utils
from Products.CMFCore.DirectoryView import registerDirectory
from Products.Escola.config import SKINS_DIR, GLOBALS, PROJECTNAME

registerDirectory(SKINS_DIR, GLOBALS)

def initialize(context):

    from content import * # importa todos os modulos do diretorio content

    content_types, constructors, ftis = process_types(
        listTypes(PROJECTNAME),
        PROJECTNAME)

    allTypes = zip(content_types, constructors)
    for atype, constructor in allTypes:
        kind = "%s: %s" % (PROJECTNAME, atype.portal_type)
        utils.ContentInit(kind,
                          content_types      = (atype,),
                          extra_constructors = (constructor,),
                          fti                = ftis,
                          ).initialize(context)freebsd#