Commits

Anonymous committed 780e5ad

Bugfix for ticket #1: perfstat couldn't compute a viewname for a MultiView view callable.

Comments (0)

Files changed (1)

pyramid_perfstat/perf_serializer.py

                 view_callable = registry.adapters.lookup(
                     (IViewClassifier, request_iface, Interface),
                     IView, name='', default=None)
-                view_callable = ".".join((view_callable.__module__,view_callable.__name__))
-
-            self.view_name = view_callable
+                if 'MultiView' in str(type(view_callable)):
+                    view_callable = view_callable.match(None, request) # TODO MultiView.match() expects a context as a first arg. I guess it would be preferrable to provide this information instead of None.
+                self.view_name = ".".join((view_callable.__module__,view_callable.__name__))
 
     def init_db(self, from_scratch=False):
         """
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.