[Grok-dev] Generations problem

Svenn Helge Grindhaug svenn.grindhaug at uni.no
Wed Sep 7 07:26:15 EST 2011


Hi,

I'm having problems getting zope.generations to work with Grok 1.4. I'm 
following the howto here: 

http://grok.zope.org/doc/community/topics/generations.html

I want to have an instance of my app installed in the root folder on first 
startup. But the evolve function in hodweb.generation.install is never called.
I don't get any error messages either. 

Suggestions appreciated.


[hodweb.app]

import grok

from hodweb import resource
import zope.interface

class Hodweb(grok.Application, grok.Container):
    pass


[hodweb.generations.util]

import grok
from zope.generations.generations import SchemaManager
from zope.generations.interfaces import ISchemaManager


schemaManager = SchemaManager(
    minimum_generation=0,
    generation=0,
    package_name='hodweb.generation'
)


grok.global_utility(
    schemaManager,
    provides=ISchemaManager,
    name="hodweb",
    direct=True
)

[hodweb.generations.install]

from hodweb.app import Hodweb
from zope.generations.utility import getRootFolder

def evolve(context):
    root = getRootFolder(context)
    root['app'] = Hodweb()
    print "CREATED App"


Best regards,

Svenn.


More information about the Grok-dev mailing list