-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
implement HTML JSON form style per spec #2682
Conversation
Wow. Okay will try to sit down and properly review some time. Interesting stuff. |
83b1f7c
to
30dce52
Compare
Rebased. FWIW, I've been using this in production for a couple of wq.db-based projects and have found find it quite useful for populating nested serializers with simple HTML forms (e.g. in these tests). There are a couple of things I haven't addressed yet:
|
186e355
to
303a304
Compare
@sheppard I'm trying to address the oldest PR. |
It's certainly up in the air given the status of the spec. The main argument for keeping it is just that it's a bit more robust than what we have now (see #2148). While I was waiting for this to sort out, I went ahead and put the implementation in a standalone package (html-json-forms). It might make sense to just link to that package for now and see how much interest there is. |
@sheppard - That sounds like a great option - works for me! Let's close this in favor of linking in the docs. We can always re-assess at a later date. |
Here's a first pass at #2148. I was able to make it work with the existing tests with minor modifications (to both the algorithm and the tests). The next thing to do is to add more tests to handle the new uses that are now possible.
Let me know if you would me to change the comment style - this is basically a line-for-line translation of the spec to Python, including numbers referencing each step in the spec. I wouldn't normally code like that, but I then again I don't usually get to implement a spec from scratch either.
There were a couple of ambiguities in the spec that I resolved by looking at what I assume is the reference implementation:
https://github.com/darobin/formic/blob/gh-pages/json/json.js
I'll try to follow up with the authors to get those ambiguities clarified.