diff options
| author | Michael Merickel <michael@merickel.org> | 2016-03-08 23:46:04 -0600 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2016-03-08 23:46:04 -0600 |
| commit | dad9505d95824ce65e557d9e29044291ccc3a904 (patch) | |
| tree | 5f0af9d8c436663ae4dbd66a466b06cedc9e0aba | |
| parent | e292cca8a2f07090697435b7fcdfb2d827e88f44 (diff) | |
| download | pyramid-dad9505d95824ce65e557d9e29044291ccc3a904.tar.gz pyramid-dad9505d95824ce65e557d9e29044291ccc3a904.tar.bz2 pyramid-dad9505d95824ce65e557d9e29044291ccc3a904.zip | |
remove order and phash from deriver options
the order and phash are not technically options and are only passed to
make the predicated deriver work which is only a deriver as an
implementation detail
| -rw-r--r-- | pyramid/config/derivations.py | 11 | ||||
| -rw-r--r-- | pyramid/config/views.py | 7 |
2 files changed, 10 insertions, 8 deletions
diff --git a/pyramid/config/derivations.py b/pyramid/config/derivations.py index e6179d35f..0e109f425 100644 --- a/pyramid/config/derivations.py +++ b/pyramid/config/derivations.py @@ -342,10 +342,9 @@ def predicated_view(view, info): return predicate_wrapper def attr_wrapped_view(view, info): - opts = info.options - accept, order, phash = (opts.get('accept', None), - opts.get('order', MAX_ORDER), - opts.get('phash', DEFAULT_PHASH)) + accept, order, phash = (info.options.get('accept', None), + getattr(info, 'order', MAX_ORDER), + getattr(info, 'phash', DEFAULT_PHASH)) # this is a little silly but we don't want to decorate the original # function with attributes that indicate accept, order, and phash, # so we use a wrapper @@ -360,8 +359,8 @@ def attr_wrapped_view(view, info): attr_view.__accept__ = accept attr_view.__order__ = order attr_view.__phash__ = phash - attr_view.__view_attr__ = opts.get('attr') - attr_view.__permission__ = opts.get('permission') + attr_view.__view_attr__ = info.options.get('attr') + attr_view.__permission__ = info.options.get('permission') return attr_view def rendered_view(view, info): diff --git a/pyramid/config/views.py b/pyramid/config/views.py index 0ffcc81b0..fbf91f3ae 100644 --- a/pyramid/config/views.py +++ b/pyramid/config/views.py @@ -1229,8 +1229,6 @@ class ViewsConfiguratorMixin(object): wrapper=wrapper_viewname, name=viewname, accept=accept, - order=order, - phash=phash, mapper=mapper, decorator=decorator, http_cache=http_cache, @@ -1246,6 +1244,11 @@ class ViewsConfiguratorMixin(object): options=options, ) + # order and phash are only necessary for the predicated view and + # are not really view derivation options + info.order = order + info.phash = phash + return self._apply_view_derivations(info) @viewdefaults |
