level12 / keg-app-cookiecutter

0 stars 0 forks source link

allow grid header posts by default #150

Closed guruofgentoo closed 3 years ago

guruofgentoo commented 3 years ago

Newer webgrid, keg-elements, and keg-auth all support posts from the grid header. But, these are enabled conditionally based on the grid extension's args loaders.

Just need to add RequestFormLoader to the list.

rsyring commented 3 years ago

@guruofgentoo can you give me an example of this?

guruofgentoo commented 3 years ago

Something like https://github.com/level12/keg-elements/blob/86cfe0e7168b5c2a1e20ffc854569fc8375fe12b/kegel_app/extensions.py#L45. We'd probably want RequestArgsLoader, RequestFormLoader, and WebSessionLoader, in that order.

Loaders can be defined on the manager class or passed into the constructor.

Affects https://github.com/level12/keg-app-cookiecutter/blob/master/%7B%7Bcookiecutter.project_dashed%7D%7D-src/%7B%7Bcookiecutter.project_pymod%7D%7D/libs/grids.py#L6

rsyring commented 3 years ago

@guruofgentoo please confirm the commit just above is what you want.

If this is a good default, should that be what we have upstream?

guruofgentoo commented 3 years ago

I think both request-related loaders should come before the session. That affects the precedence, i.e. if an arg is in a form post, the posted arg value should override something in the session store.

I wanted to give our keg apps a chance to support this before it goes upstream in webgrid as the default. Post will become the default target from the grid header, and that's breaking if the views don't support that method (which, traditionally, our grid views have not). I think I've documented that in webgrid, with the intention to make the change whenever we want to move to 0.5 there.

rsyring commented 3 years ago

Thanks. I meant to do it the way you specified the first time. :o)