summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2010-11-04 00:31:24 -0400
committerChris McDonough <chrism@plope.com>2010-11-04 00:31:24 -0400
commit1b5c612676b9cfae8d28c5edb73546b3d683f4e2 (patch)
treee2b3e6596af009187ea1058daec8d0830af5588a
parent30c27f26f2d34be9bdb04e15c8f6a2b2afd59120 (diff)
parent4d3666e2ba734e6f5d4557347cd2e12b63b2b558 (diff)
downloadpyramid-1b5c612676b9cfae8d28c5edb73546b3d683f4e2.tar.gz
pyramid-1b5c612676b9cfae8d28c5edb73546b3d683f4e2.tar.bz2
pyramid-1b5c612676b9cfae8d28c5edb73546b3d683f4e2.zip
Merge branch 'dezcml' of github.com:Pylons/pyramid into dezcml
-rw-r--r--pyramid/paster_templates/alchemy/+package+/configure.zcml23
-rw-r--r--pyramid/paster_templates/alchemy/+package+/run.py_tmpl7
-rw-r--r--pyramid/paster_templates/routesalchemy/+package+/configure.zcml18
-rw-r--r--pyramid/paster_templates/routesalchemy/+package+/run.py_tmpl5
4 files changed, 8 insertions, 45 deletions
diff --git a/pyramid/paster_templates/alchemy/+package+/configure.zcml b/pyramid/paster_templates/alchemy/+package+/configure.zcml
deleted file mode 100644
index 9450b9049..000000000
--- a/pyramid/paster_templates/alchemy/+package+/configure.zcml
+++ /dev/null
@@ -1,23 +0,0 @@
-<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>
diff --git a/pyramid/paster_templates/alchemy/+package+/run.py_tmpl b/pyramid/paster_templates/alchemy/+package+/run.py_tmpl
index 610b9ed2d..2e349f482 100644
--- a/pyramid/paster_templates/alchemy/+package+/run.py_tmpl
+++ b/pyramid/paster_templates/alchemy/+package+/run.py_tmpl
@@ -9,7 +9,6 @@ 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.")
@@ -17,7 +16,11 @@ def app(global_config, **settings):
get_root = appmaker(db_string, asbool(db_echo))
config = Configurator(settings=settings, root_factory=get_root)
config.begin()
- config.load_zcml(zcml_file)
+ 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.end()
return config.make_wsgi_app()
diff --git a/pyramid/paster_templates/routesalchemy/+package+/configure.zcml b/pyramid/paster_templates/routesalchemy/+package+/configure.zcml
deleted file mode 100644
index 47adfbefb..000000000
--- a/pyramid/paster_templates/routesalchemy/+package+/configure.zcml
+++ /dev/null
@@ -1,18 +0,0 @@
-<configure xmlns="http://pylonshq.com/pyramid">
-
- <!-- this must be included for the view declarations to work -->
- <include package="pyramid.includes" />
-
- <route
- pattern=""
- name="home"
- view=".views.my_view"
- view_renderer="templates/mytemplate.pt"
- />
-
- <static
- name="static"
- path="templates/static"
- />
-
-</configure>
diff --git a/pyramid/paster_templates/routesalchemy/+package+/run.py_tmpl b/pyramid/paster_templates/routesalchemy/+package+/run.py_tmpl
index 695cd12fe..9edcd28c8 100644
--- a/pyramid/paster_templates/routesalchemy/+package+/run.py_tmpl
+++ b/pyramid/paster_templates/routesalchemy/+package+/run.py_tmpl
@@ -9,7 +9,6 @@ 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.")
@@ -17,7 +16,9 @@ def app(global_config, **settings):
initialize_sql(db_string, asbool(db_echo))
config = Configurator(settings=settings)
config.begin()
- config.load_zcml(zcml_file)
+ config.add_static_view('static', 'templates/static')
+ config.add_route('home', '/', view='.views.my_view',
+ renderer='templates/mytemplate.pt')
config.end()
return config.make_wsgi_app()