[Grok-dev] Generations problem

Christian Klinger cklinger at novareto.de
Thu Sep 8 08:32:28 EST 2011


Hi Svenn,

i guess this is because the configure.zcml from zope.generations is not 
picked up. You can do two things:

1) Put zope.generations in your setup.py  --> install-requires.
2) add <include pacakge="zope.generations"> in your configure.zcml

I created a modified version in the "not yet released" documentation of 
grok [1]

Hope this helps
Christian

[1] 
https://bitbucket.org/jhsware/grok-doc/src/62ff456c0eec/source/topics/generations.rst


> 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