Generations problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Generations problem

Svenn Helge Grindhaug-2
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.
_______________________________________________
Grok-dev mailing list
[hidden email]
https://mail.zope.org/mailman/listinfo/grok-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Generations problem

Christian Klinger
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.


_______________________________________________
Grok-dev mailing list
[hidden email]
https://mail.zope.org/mailman/listinfo/grok-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Generations problem

Svenn Helge Grindhaug-2
On Thursday, September 08, 2011 03:32:28 PM Christian Klinger wrote:
> 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

1) was already there and adding 2) and fixing the typo (see below) did not
result in having the hodweb app being added at first startup.

I also added a pdb in zope.generations.generations.SchemaManager.install, but
it never get called.

This is working fine in an other project but then with Grok 1.0 and
zope.app.generations instead of zope.generations.

Does Grok 1.4 and zope.generations work for everyone else?

Cheers,

Svenn.

> 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/gener
> ations.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'

Typo. It should say 'hodweb.generations'. Fixing it did not help.

> > )
> >
> >
> > 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.
>
> _______________________________________________
> Grok-dev mailing list
> [hidden email]
> https://mail.zope.org/mailman/listinfo/grok-dev
_______________________________________________
Grok-dev mailing list
[hidden email]
https://mail.zope.org/mailman/listinfo/grok-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Generations problem

Christian Klinger
Hi Svenn,

i think i found the missing bit. It seems you have to explicit register
subscriber.zcml of zope.generations. So please try to add


<include package="zope.generations" file="subscriber.zcml" />


I think then the stuff will work.

Christian

> On Thursday, September 08, 2011 03:32:28 PM Christian Klinger wrote:
>> 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
>
> 1) was already there and adding 2) and fixing the typo (see below) did not
> result in having the hodweb app being added at first startup.
>
> I also added a pdb in zope.generations.generations.SchemaManager.install, but
> it never get called.
>
> This is working fine in an other project but then with Grok 1.0 and
> zope.app.generations instead of zope.generations.
>
> Does Grok 1.4 and zope.generations work for everyone else?
>
> Cheers,
>
> Svenn.
>
>> 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/gener
>> ations.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'
>
> Typo. It should say 'hodweb.generations'. Fixing it did not help.
>
>>> )
>>>
>>>
>>> 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.
>>
>> _______________________________________________
>> Grok-dev mailing list
>> [hidden email]
>> https://mail.zope.org/mailman/listinfo/grok-dev


_______________________________________________
Grok-dev mailing list
[hidden email]
https://mail.zope.org/mailman/listinfo/grok-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Generations problem

Svenn Helge Grindhaug-2
On Tuesday, September 13, 2011 09:40:53 PM Christian Klinger wrote:

> Hi Svenn,
>
> i think i found the missing bit. It seems you have to explicit register
> subscriber.zcml of zope.generations. So please try to add
>
>
> <include package="zope.generations" file="subscriber.zcml" />
>
>
> I think then the stuff will work.

Thanks Christian, working fine now.

Cheers,

Svenn.
_______________________________________________
Grok-dev mailing list
[hidden email]
https://mail.zope.org/mailman/listinfo/grok-dev
Loading...