diff options
| author | Bert JW Regeer <bertjw@regeer.org> | 2015-10-16 00:03:06 -0600 |
|---|---|---|
| committer | Bert JW Regeer <bertjw@regeer.org> | 2015-10-20 23:21:27 -0600 |
| commit | e31224c7f7706b960e3c048b987a39a94cbfaa49 (patch) | |
| tree | 0ddd5d18e2b16b704efc84317a067815603e0ffc | |
| parent | 628c748efb8c2a3a88c224cbe1abf4ec0eb8e736 (diff) | |
| download | pyramid-e31224c7f7706b960e3c048b987a39a94cbfaa49.tar.gz pyramid-e31224c7f7706b960e3c048b987a39a94cbfaa49.tar.bz2 pyramid-e31224c7f7706b960e3c048b987a39a94cbfaa49.zip | |
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.
| -rw-r--r-- | pyramid/config/views.py | 3 |
1 files changed, 2 insertions, 1 deletions
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 |
