From 98e0d06a77fef4cec0266510f2d02975ce56c405 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 4 Feb 2010 13:02:41 +0000 Subject: - 1.2b4 introduced a bug whereby views added via a route configuration that named a view callable and also a ``view_attr`` became broken. Symptom: ``MyViewClass is not callable`` or the ``__call__`` of a class was being called instead of the method named via ``view_attr``. --- repoze/bfg/tests/restbugapp/__init__.py | 1 + repoze/bfg/tests/restbugapp/configure.zcml | 25 +++++++++++++++++++++++++ repoze/bfg/tests/restbugapp/views.py | 18 ++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 repoze/bfg/tests/restbugapp/__init__.py create mode 100644 repoze/bfg/tests/restbugapp/configure.zcml create mode 100644 repoze/bfg/tests/restbugapp/views.py (limited to 'repoze/bfg/tests/restbugapp') diff --git a/repoze/bfg/tests/restbugapp/__init__.py b/repoze/bfg/tests/restbugapp/__init__.py new file mode 100644 index 000000000..5bb534f79 --- /dev/null +++ b/repoze/bfg/tests/restbugapp/__init__.py @@ -0,0 +1 @@ +# package diff --git a/repoze/bfg/tests/restbugapp/configure.zcml b/repoze/bfg/tests/restbugapp/configure.zcml new file mode 100644 index 000000000..67954b892 --- /dev/null +++ b/repoze/bfg/tests/restbugapp/configure.zcml @@ -0,0 +1,25 @@ + + + + + + + + + diff --git a/repoze/bfg/tests/restbugapp/views.py b/repoze/bfg/tests/restbugapp/views.py new file mode 100644 index 000000000..eb6a6591d --- /dev/null +++ b/repoze/bfg/tests/restbugapp/views.py @@ -0,0 +1,18 @@ +from webob import Response + +class BaseRESTView(object): + def __init__(self, context, request): + self.context = context + self.request = request + +class PetRESTView(BaseRESTView): + """ REST Controller to control action of an avatar """ + def __init__(self, context, request): + super(PetRESTView, self).__init__(context, request) + + def GET(self): + return Response('gotten') + + def POST(self): + return Response('posted') + -- cgit v1.2.3