diff options
Diffstat (limited to 'docs/tutorials/zeo')
| -rw-r--r-- | docs/tutorials/zeo/index.rst | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/docs/tutorials/zeo/index.rst b/docs/tutorials/zeo/index.rst index e2d9953c2..d9caf7d0a 100644 --- a/docs/tutorials/zeo/index.rst +++ b/docs/tutorials/zeo/index.rst @@ -154,6 +154,12 @@ Configuration class MyModel(Folder): pass + def appmaker(root): + if not 'myapp' in root: + root['myapp'] = MyModel() + transaction.commit() + return root['myapp'] + #. Change your application's ``run.py`` to look something like the below: @@ -161,7 +167,7 @@ Configuration from repoze.bfg.configuration import Configurator from repoze.zodbconn.finder import PersistentApplicationFinder - from myapp.models import MyModel + from myapp.models import appmaker import transaction def app(global_config, **settings): @@ -176,12 +182,6 @@ Configuration config = Configurator(root_factory=get_root, settings=settings) return config.make_wsgi_app() - def appmaker(root): - if not 'myapp' in root: - root['myapp'] = MyModel() - transaction.commit() - return root['myapp'] - Running ------- |
