-
Notifications
You must be signed in to change notification settings - Fork 136
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
Report the choice name in the JSON #354
Conversation
Codecov Report
@@ Coverage Diff @@
## master #354 +/- ##
==========================================
- Coverage 82.51% 82.49% -0.02%
==========================================
Files 23 23
Lines 3255 3257 +2
Branches 758 758
==========================================
+ Hits 2686 2687 +1
Misses 433 433
- Partials 136 137 +1
Continue to review full report at Codecov.
|
The In the case of dynamic selects, the name is exposed as In the case of a static select, that name isn't used in the underlying XForms so that's probably why it wasn't exposed. Perhaps I don't work on any tools that use the JSON representation. @jnm, you do, right? I think it's generally in an odd state and would be worth some cleanup if folks are depending on it. |
Hi, We use the JSON output extensively in our applications through ODK Tools which convert an ODK Excel Survey file into a MySQL database. The list name is used to create a child look-up table with the options that then is linked to the parent data-table. The list_name is important because we use it to name the look-up table. I don't know who is the maintainer of the JSON part of pyxform but I would be happy to contribute if it does not have a patron. I will upload the change to the PR soon. |
This reverts commit 058531d494fd68ecfba7d1c75c8b2175c128960a, reversing changes made to 896598e.
Thanks for that extra context, @qlands. I understand why in your case you'd want to represent the choice list once even though in the corresponding XForm it would be copied for each question that uses it. What I might do in that case is use a hash of the In #203, I ask why static choice lists are ever generated. Another possible resolution to your issue would be to always generate secondary instances for choice lists since those do have names (accessible through Because there is no concept corresponding to |
I could generate a hash as name but such name will not correspond to anything in the XLS form. Secondary instances generate "itemset" or "query" however I cannot force users to a particular format for select. I understand that list_name is not part of XForm however I'm not asking to change the XForm representation just the JSON by adding the list name. On other note: I ran black on my files....where can I check which file went without black? |
This reverts commit 8f1abf3.
Sorry people... I messes up with this PR. I will open other one cleaner without so many reverts!!! |
We can continue the discussion in #357 . Thanks. |
The current JSON output does not contain the list name for "normal" select_one or select_multiple variables. It is useful to have it specially if one wants to construct a data dictionary.
I used the same key ("query") as is already used by "select one external" types.