From 81a833da2adff04d11b9228406bbc1528be65c64 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 24 Jul 2010 07:04:49 +0000 Subject: - A new method of the ``Configurator`` exists: ``set_request_factory``. If used, this method will set the factory used by the :mod:`repoze.bfg` router to create all request objects. - The ``Configurator`` constructor takes an additional argument: ``request_factory``. If used, this argument will set the factory used by the :mod:`repoze.bfg` router to create all request objects. - The ``Hooks`` narrative chapter now contains a section about changing the request factory. --- repoze/bfg/interfaces.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'repoze/bfg/interfaces.py') diff --git a/repoze/bfg/interfaces.py b/repoze/bfg/interfaces.py index 814e558f6..992ec80d9 100644 --- a/repoze/bfg/interfaces.py +++ b/repoze/bfg/interfaces.py @@ -87,6 +87,16 @@ class IResponseFactory(Interface): should accept all the arguments that the webob.Response class accepts)""" +class IRequestFactory(Interface): + """ A utility which generates a request """ + def __call__(environ): + """ Return an object implementing IRequest, e.g. an instance + of ``repoze.bfg.request.Request``""" + + def blank(path): + """ Return an empty request object (see + ``webob.Request.blank``)""" + class IViewClassifier(Interface): """ *Internal only* marker interface for views.""" -- cgit v1.2.3