Skip to content

Commit

Permalink
Fix DatabaseCreatedEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
thefunny42 committed Jun 5, 2015
1 parent b82a140 commit c93c2bc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/grok/generations.py
Expand Up @@ -4,16 +4,20 @@
import zope.event

from zope.generations.interfaces import IInstallableSchemaManager
from zope.generations.utility import getRootFolder


class GrokDatabase(grokcore.component.GlobalUtility):
grokcore.component.name('grok.database')
class GrokDatabaseCreated(grokcore.component.GlobalUtility):
# The name starts with a null byte so that then they are sorted and
# executed by zope.generation it ends up to be first.
grokcore.component.name('\x00grok database created')
grokcore.component.implements(IInstallableSchemaManager)

minimum_generation = generation = 1

def install(self, context):
zope.event.notify(grok.events.DatabaseCreatedEvent(context))
root = getRootFolder(context)
zope.event.notify(grok.events.DatabaseCreatedEvent(root))

def evolve(self, context, generation):
pass

0 comments on commit c93c2bc

Please sign in to comment.