diff options
Diffstat (limited to 'docs/tutorials')
| -rw-r--r-- | docs/tutorials/catalog/index.rst | 8 | ||||
| -rw-r--r-- | docs/tutorials/zeo/index.rst | 14 |
2 files changed, 7 insertions, 15 deletions
diff --git a/docs/tutorials/catalog/index.rst b/docs/tutorials/catalog/index.rst index 5e6b00e69..9a5bbfb2f 100644 --- a/docs/tutorials/catalog/index.rst +++ b/docs/tutorials/catalog/index.rst @@ -71,14 +71,6 @@ want the application to be based on :term:`traversal`. if name not in indexes: del catalog[name] -#. Change the ``appmaker`` in your application's ``run.py`` to look - something like the below: - - .. code-block:: python - :linenos: - - from myapp.models import Site - def appmaker(root): if not 'site' in root: root['site'] = Site() 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 ------- |
