view() now only accepts filter parameters, rather than silently ignoring link parameters which should be given to view().link instead.
Fixes #506
Detailed description
There was an issue with how view-as-call-site accidentally made it too easy to pass in a silently-ignored parameter such as doing <a href="{{view.previous(template='foo')}}> instead of the (correct) <a href="{{view.previous.link(template='foo')}}>. This change ensures that only valid filter parameters get passed into the filter query.
This also finally refactored some fairly hairy, un-Pythonic code to be more Pythonic, so that's a nice bonus.
Developer/user impact
Templates will no longer silently fail if a link parameter is being passed into a filter context. Any errors caused by this were actually errors before, they were just not visibly so.
Test plan
Ran all of the related tests, and also added a test_invalid_filter_arg template which fails on purpose. Also tested it against the beesbuzz.biz templates, which identified a couple of issues on that site as well as verified some more advanced pagination behavior which doesn't currently have a test.
Summary
view()
now only accepts filter parameters, rather than silently ignoring link parameters which should be given toview().link
instead.Fixes #506
Detailed description
There was an issue with how view-as-call-site accidentally made it too easy to pass in a silently-ignored parameter such as doing
<a href="{{view.previous(template='foo')}}>
instead of the (correct)<a href="{{view.previous.link(template='foo')}}>
. This change ensures that only valid filter parameters get passed into the filter query.This also finally refactored some fairly hairy, un-Pythonic code to be more Pythonic, so that's a nice bonus.
Developer/user impact
Templates will no longer silently fail if a link parameter is being passed into a filter context. Any errors caused by this were actually errors before, they were just not visibly so.
Test plan
Ran all of the related tests, and also added a
test_invalid_filter_arg
template which fails on purpose. Also tested it against the beesbuzz.biz templates, which identified a couple of issues on that site as well as verified some more advanced pagination behavior which doesn't currently have a test.TODO: properly unit test stuff, seriously
Got a site to show off?