diff options
| author | kenmanheimer <ken.manheimer@gmail.com> | 2011-11-08 17:18:21 -0800 |
|---|---|---|
| committer | kenmanheimer <ken.manheimer@gmail.com> | 2011-11-08 17:18:21 -0800 |
| commit | 0e35fa7c7bc93f143f15ba4ff4bcfb7cfe2129bc (patch) | |
| tree | 8611bc76e439c3239df159729412829e4cc1108f | |
| parent | 9b215d25112e7f466512ebbcfb2007abe070c9f7 (diff) | |
| download | pyramid-0e35fa7c7bc93f143f15ba4ff4bcfb7cfe2129bc.tar.gz pyramid-0e35fa7c7bc93f143f15ba4ff4bcfb7cfe2129bc.tar.bz2 pyramid-0e35fa7c7bc93f143f15ba4ff4bcfb7cfe2129bc.zip | |
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.
| -rw-r--r-- | docs/tutorials/wiki/src/authorization/tutorial/login.py | 9 |
1 files changed, 4 insertions, 5 deletions
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) - |
