summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/narr/events.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/narr/events.rst b/docs/narr/events.rst
index 900f8499d..fbc88bf23 100644
--- a/docs/narr/events.rst
+++ b/docs/narr/events.rst
@@ -134,10 +134,10 @@ object provided by the event. Here's an example.
def categorize_request(event):
request = event.request
accept = request.headers.get('accept', '')
- if 'application/xml' in accept:
- alsoProvides(request, IRestRequest)
if 'application/json' in accept:
alsoProvides(request, IJSONRequest)
+ elif 'application/xml' in accept:
+ alsoProvides(request, IRestRequest)
Then in your view registration ZCML, you can use the ``request_type``
attribute to point at different view functions depending upon the