Skip to content

Commit

Permalink
Revert "Changed to use imperative config."
Browse files Browse the repository at this point in the history
This reverts commit 84e445d.
  • Loading branch information
bbangert committed Nov 4, 2010
1 parent 96d7897 commit 20fbdee
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
23 changes: 23 additions & 0 deletions pyramid/paster_templates/alchemy/+package+/configure.zcml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<configure xmlns="http://pylonshq.com/pyramid">

<!-- this must be included for the view declarations to work -->
<include package="pyramid.includes" />

<view
context=".models.MyApp"
view=".views.view_root"
renderer="templates/root.pt"
/>

<view
context=".models.MyModel"
view=".views.view_model"
renderer="templates/model.pt"
/>

<static
name="static"
path="templates/static"
/>

</configure>
7 changes: 2 additions & 5 deletions pyramid/paster_templates/alchemy/+package+/run.py_tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,15 @@ def app(global_config, **settings):
It is usually called by the PasteDeploy framework during
``paster serve``.
"""
zcml_file = settings.get('configure_zcml', 'configure.zcml')
db_string = settings.get('db_string')
if db_string is None:
raise ValueError("No 'db_string' value in application configuration.")
db_echo = settings.get('db_echo', 'false')
get_root = appmaker(db_string, asbool(db_echo))
config = Configurator(settings=settings, root_factory=get_root)
config.begin()
config.add_static_view('static', 'templates/static')
config.add_view('.views.view_root', context='.models.MyApp',
renderer="templates/root.pt")
config.add_view('.views.view_model', context='.models.MyModel',
renderer="templates/model.pt")
config.load_zcml(zcml_file)
config.end()
return config.make_wsgi_app()

0 comments on commit 20fbdee

Please sign in to comment.