diff options
| author | Chris McDonough <chrism@agendaless.com> | 2010-01-03 09:20:45 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2010-01-03 09:20:45 +0000 |
| commit | eaf661a98c3ec395147a488af94eaa8a9ad36a19 (patch) | |
| tree | 89ac3b66745880f22dd27cad39dded711d1efe64 /docs/tutorials/zeo | |
| parent | b65c43c593cf777ba3f7af3d15b9eec5a76b7586 (diff) | |
| download | pyramid-eaf661a98c3ec395147a488af94eaa8a9ad36a19.tar.gz pyramid-eaf661a98c3ec395147a488af94eaa8a9ad36a19.tar.bz2 pyramid-eaf661a98c3ec395147a488af94eaa8a9ad36a19.zip | |
Normalize.
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 ------- |
