From 4466bb20f3dada4d7fde0aff0a49213d8eb177ab Mon Sep 17 00:00:00 2001 From: kenmanheimer Date: Tue, 8 Nov 2011 11:56:25 -0800 Subject: Convert absolute 'tutorial' package references that are from within the package to relative ones, to reduce brittleness, eg when the user names the package something other than 'tutorial'. - make imports relative - use plain relative URLs for resources (like stylesheets and images) in page templates. --- docs/tutorials/wiki/src/models/tutorial/__init__.py | 4 ++-- docs/tutorials/wiki/src/models/tutorial/templates/mytemplate.pt | 8 ++++---- docs/tutorials/wiki/src/models/tutorial/views.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'docs/tutorials/wiki/src/models') diff --git a/docs/tutorials/wiki/src/models/tutorial/__init__.py b/docs/tutorials/wiki/src/models/tutorial/__init__.py index 2d637b9de..1fbb2bedb 100644 --- a/docs/tutorials/wiki/src/models/tutorial/__init__.py +++ b/docs/tutorials/wiki/src/models/tutorial/__init__.py @@ -1,6 +1,6 @@ from pyramid.config import Configurator from pyramid_zodbconn import get_connection -from tutorial.models import appmaker +from .models import appmaker def root_factory(request): conn = get_connection(request) @@ -10,7 +10,7 @@ def main(global_config, **settings): """ This function returns a WSGI application. """ config = Configurator(root_factory=root_factory, settings=settings) - config.add_static_view('static', 'tutorial:static', cache_max_age=3600) + config.add_static_view('static', 'static', cache_max_age=3600) config.scan('tutorial') return config.make_wsgi_app() diff --git a/docs/tutorials/wiki/src/models/tutorial/templates/mytemplate.pt b/docs/tutorials/wiki/src/models/tutorial/templates/mytemplate.pt index 14b88d16a..3597c679b 100644 --- a/docs/tutorials/wiki/src/models/tutorial/templates/mytemplate.pt +++ b/docs/tutorials/wiki/src/models/tutorial/templates/mytemplate.pt @@ -5,19 +5,19 @@ - + - +
-
pyramid
+
pyramid
diff --git a/docs/tutorials/wiki/src/models/tutorial/views.py b/docs/tutorials/wiki/src/models/tutorial/views.py index 2346602c9..7c1f1d228 100644 --- a/docs/tutorials/wiki/src/models/tutorial/views.py +++ b/docs/tutorials/wiki/src/models/tutorial/views.py @@ -1,5 +1,5 @@ from pyramid.view import view_config -@view_config(renderer='tutorial:templates/mytemplate.pt') +@view_config(renderer='templates/mytemplate.pt') def my_view(request): return {'project':'tutorial'} -- cgit v1.2.3