From e31224c7f7706b960e3c048b987a39a94cbfaa49 Mon Sep 17 00:00:00 2001 From: Bert JW Regeer Date: Fri, 16 Oct 2015 00:03:06 -0600 Subject: View derivations get their name as a kwarg as a value Instead of passing in a default to the view derivation, we attempt to pull it out of the options kwarg, if that doesn't exist, then we pass in the default. This should make it simpler to program view derivations because now you don't need to check to see if the kwarg is different from the default. --- pyramid/config/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyramid/config/views.py b/pyramid/config/views.py index 765f9c816..ee35ae217 100644 --- a/pyramid/config/views.py +++ b/pyramid/config/views.py @@ -1024,7 +1024,8 @@ class ViewsConfiguratorMixin(object): derivers = self.registry.queryUtility(IViewDerivers, default=[]) for name, val in inner_derivers + derivers.sorted() + outer_derivers: derivation, default = val - view = wraps_view(derivation)(view, default, **kw) + value = kw['options'].get(name, default) + view = wraps_view(derivation)(view, value, **kw) return view @action_method -- cgit v1.2.3