pyramid.threadlocal

get_current_request()[ソース]

Return the currently active request or None if no request is currently active.

This function should be used extremely sparingly, usually only in unit testing code. It's almost always usually a mistake to use get_current_request outside a testing context because its usage makes it possible to write code that can be neither easily tested nor scripted.

get_current_registry()[ソース]

Return the currently active application registry or the global application registry if no request is currently active.

This function should be used extremely sparingly, usually only in unit testing code. It's almost always usually a mistake to use get_current_registry outside a testing context because its usage makes it possible to write code that can be neither easily tested nor scripted.