Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow selecting GET/POST for forms #396

Merged
merged 16 commits into from
Sep 5, 2013
Merged

Conversation

jean
Copy link
Member

@jean jean commented Aug 31, 2013

Forms get a dropdown for form method, defaulting to POST.
Current tests pass, but I haven't written tests for GET forms yet.

Don't merge yet.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) when pulling 10196f7 on jean-GET-POST-issue380 into 58e1354 on github-main.

Create an accessor for the FormMethod form field to handle Auto.
Or should it honour the form method?
Both for form and for any datagrid on the form.
@jean
Copy link
Member Author

jean commented Sep 1, 2013

We now have tests, 'Auto' by default, and datagrid method following form's method.

@djay do we actually want to control datagrid's method, or should it always be GET? (Whether in read or edit mode, the datagrid field only reads from the server. Write is only upon form submit.)

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) when pulling a808239 on jean-GET-POST-issue380 into 58e1354 on github-main.

It doesn't change anything serverside.
Also give the datagrid script an id, can't hurt.
This shows how to do per-datagrid-field matching.
If it turns out we want tojson to sometimes POST, we can put it back.
@jean
Copy link
Member Author

jean commented Sep 1, 2013

OK, datagrids always GET now. So don't bother checking their method.
@ebrehault please have a look if you have a chance.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) when pulling ba8f265 on jean-GET-POST-issue380 into 58e1354 on github-main.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) when pulling ba8f265 on jean-GET-POST-issue380 into 58e1354 on github-main.

@djay
Copy link
Contributor

djay commented Sep 1, 2013

Data grid should always be a get if its just reading. Same with hidewhen checks.

@jean
Copy link
Member Author

jean commented Sep 2, 2013

Something to note:
http://datatables.net/forums/discussion/11416/sorting-trouble-super-long-http-request-strings/p1
"when I sort, the AJAX HTTP request string is very long, so much so that if I add a hidden column, it exceeds a server-configured length and the server rejects it".

Is GET request length still an issue? If so, it also motivates POST for computehidewhens (#388). Maybe there should be a database-global setting for the method to use for AJAX?

This is the simplest way to be able to choose the AJAX method a form
should use, e.g. if the AJAX calls need to use POST because of a
very bulky form.

It means that AJAX will sometimes use POST unnecessarily. We can
revisit this later.
TODO: still need a test for computehidewhens
@jean
Copy link
Member Author

jean commented Sep 2, 2013

After more discussion with @djay: AJAX calls use the same method as the form they're on.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) when pulling f92ebfb on jean-GET-POST-issue380 into 58e1354 on github-main.

jean referenced this pull request Sep 3, 2013
changed POST to GET for datagrid read view
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) when pulling 23087c6 on jean-GET-POST-issue380 into 452f7b3 on github-main.

ebrehault added a commit that referenced this pull request Sep 5, 2013
@ebrehault ebrehault merged commit d1e3a88 into github-main Sep 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants