Closed SupraSummus closed 1 week ago
I'll merge this as a broken commit so you get attribution, but I'll work on the next commit to fix CI. I'd like to remove button_type
(or make it a secret option) so users will only need to pick the method GET or POST. Since we need to support GET and POST for backwards compatibility, your way is good
@crccheck thanks a lot!
Another try at enforcing POST actions. This change is more gradual than #149 - when library user doesn't change default options the behavior is exactly the same as before the change, that is:
However, user can change this behavior using
methods
andbutton_type
kwargs. For example@action(methods=['POST'], button_type='form')
results inUnfortunately I have this tested only within my project. Also the docs are missing.
And one more thing - I think it is better to use
<input type="submit">
instead of js to submit the form. This js is need to make the buttons look the same in both versions. With proper CSS (that is beyond my ability to write ;) ) js is avoidable and we could be using pretty semantic html submit button. I took the form button template from #149.