-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #220 from cclauss/patch-1
IndentationError in ./docs/pylons/code/pyramid_handlers.py
- Loading branch information
Showing
1 changed file
with
18 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
# In the top-level __init__.py | ||
from .handlers import Hello | ||
def main(global_config, **settings): | ||
... | ||
config.include("pyramid_handlers") | ||
config.add_handler("hello", "/hello/{action}", handler=Hello) | ||
# In the top-level __init__.py | ||
from .handlers import Hello | ||
def main(global_config, **settings): | ||
... | ||
config.include("pyramid_handlers") | ||
config.add_handler("hello", "/hello/{action}", handler=Hello) | ||
|
||
# In zzz/handlers.py | ||
from pyramid_handlers import action | ||
class Hello(object): | ||
__autoexpose__ = None | ||
# In zzz/handlers.py | ||
from pyramid_handlers import action | ||
class Hello(object): | ||
__autoexpose__ = None | ||
|
||
def __init__(self, request): | ||
self.request = request | ||
def __init__(self, request): | ||
self.request = request | ||
|
||
@action | ||
def index(self): | ||
return Response('Hello world!') | ||
@action | ||
def index(self): | ||
return Response('Hello world!') | ||
|
||
@action(renderer="mytemplate.mak") | ||
def bye(self): | ||
return {} | ||
@action(renderer="mytemplate.mak") | ||
def bye(self): | ||
return {} |