Created
March 9, 2015 18:37
-
-
Save jvanasco/d0b8ba106291f40139e4 to your computer and use it in GitHub Desktop.
pyramid finished_callbacks change
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
from pyramid.view import view_config | |
def sample_callback(request): | |
pass | |
@view_config(route_name='home', renderer='templates/mytemplate.pt') | |
def my_view(request): | |
""" | |
1.6/master | |
BEFORE: request.finished_callbacks None | |
AFTER: request.finished_callbacks deque([<function sample_callback at 0x103c1ec08>]) | |
1.5.4 & previous | |
BEFORE: request.finished_callbacks () | |
AFTER: request.finished_callbacks [<function sample_callback at 0x103d18a28>] | |
""" | |
print "BEFORE: request.finished_callbacks ", request.finished_callbacks | |
request.add_finished_callback(sample_callback) | |
print "AFTER: request.finished_callbacks ", request.finished_callbacks | |
return {'project': 'MyProject'} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment