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

Use HTML JSON form style for nested HTML forms. #2148

Closed
tomchristie opened this issue Nov 27, 2014 · 6 comments
Closed

Use HTML JSON form style for nested HTML forms. #2148

tomchristie opened this issue Nov 27, 2014 · 6 comments

Comments

@tomchristie
Copy link
Member

We support nested HTML form submissions for eg. forms with nested children.

We should drop the current style of indexing the we use and instead adopting this draft proposal as the nesting style... http://www.w3.org/TR/html-json-forms/

User agents that implement this specification will transmit JSON data from their forms whenever the form's enctype attribute is set to application/json. During the transition period, user agents that do not support this encoding will fall back to using application/x-www-form-urlencoded. This can be detected on the server side, and the conversion algorithm described in this specification can be used to convert such data to JSON.

This would also pre-emptively give us support for JSON submissions using HTML forms if the draft does become adopted.

@tomchristie
Copy link
Member Author

The 'steps to parse a JSON encoding path' here... http://www.w3.org/TR/html-json-forms/#the-application-json-encoding-algorithm mean it'd be easily and well-defined to implement.

@tomchristie tomchristie modified the milestone: 3.1.0 Release Dec 8, 2014
@tomchristie
Copy link
Member Author

Pushing all further HTML specific stuff to 3.2.0.

@tomchristie
Copy link
Member Author

Our current ad-hoc approach is handled here... https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/utils/html.py

@sheppard
Copy link
Contributor

See #2682 for a potential implementation.

@rpkilby
Copy link
Member

rpkilby commented May 16, 2018

This can probably be closed off, given that:

  • The associated spec seems to be dead.
  • A third party package exists and is linked to from the docs.

@tomchristie
Copy link
Member Author

Good call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants