From 0e35fa7c7bc93f143f15ba4ff4bcfb7cfe2129bc Mon Sep 17 00:00:00 2001 From: kenmanheimer Date: Tue, 8 Nov 2011 17:18:21 -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/authorization/tutorial/login.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'docs/tutorials/wiki') diff --git a/docs/tutorials/wiki/src/authorization/tutorial/login.py b/docs/tutorials/wiki/src/authorization/tutorial/login.py index d608a7d0b..11dea050f 100644 --- a/docs/tutorials/wiki/src/authorization/tutorial/login.py +++ b/docs/tutorials/wiki/src/authorization/tutorial/login.py @@ -4,9 +4,9 @@ from pyramid.security import remember from pyramid.security import forget from pyramid.view import view_config -from tutorial.security import USERS +from .security import USERS -@view_config(context='tutorial.models.Wiki', name='login', +@view_config(context='.models.Wiki', name='login', renderer='templates/login.pt') @view_config(context='pyramid.httpexceptions.HTTPForbidden', renderer='templates/login.pt') @@ -35,10 +35,9 @@ def login(request): login = login, password = password, ) - -@view_config(context='tutorial.models.Wiki', name='logout') + +@view_config(context='.models.Wiki', name='logout') def logout(request): headers = forget(request) return HTTPFound(location = request.resource_url(request.context), headers = headers) - -- cgit v1.2.3