ObjectGroupedSelectInput is broken
Bug #557675 reported by
Forrest Aldridge
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Methanal |
Fix Released
|
High
|
Jonathan Jacobs |
Bug Description
There are two problems with the ObjectGroupedSe
First of all, according to the current design, the ObjectGroupedSe
Even when this is fixed however, a bigger problem remains:
The current code for handling the ObjectGroupedSe
Related branches
lp:~methanal-developers/methanal/enum-object-and-group-choices
- Tristan Seligmann: Approve
-
Diff: 1424 lines (+849/-170)11 files modifiedmethanal/enums.py (+94/-52)
methanal/imethanal.py (+49/-0)
methanal/js/Methanal/View.js (+1/-1)
methanal/static/styles/methanal.css (+11/-0)
methanal/test/test_enums.py (+246/-64)
methanal/test/test_view.py (+303/-5)
methanal/themes/methanal-base/methanal-multicheck-input.html (+3/-0)
methanal/themes/methanal-base/methanal-multiselect-input.html (+1/-5)
methanal/themes/methanal-base/methanal-radio-input.html (+10/-7)
methanal/themes/methanal-base/methanal-select-input.html (+0/-1)
methanal/view.py (+131/-35)
summary: |
- ObjectGroupedSelectInput is broken. + ObjectGroupedSelectInput is broken |
Changed in methanal: | |
status: | New → Triaged |
importance: | Undecided → High |
milestone: | none → 0.2.1 |
Changed in methanal: | |
status: | Triaged → In Progress |
assignee: | nobody → Jonathan Jacobs (jjacobs) |
Changed in methanal: | |
status: | In Progress → Fix Committed |
Changed in methanal: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Tristan and I spoke about this and we decided that leveraging Enum is possibly the best way forward for this whole Grouped/Object ChoiceInput spaghetti disaster.
The idea for grouping is: ChoiceInput attempts to find an "extra" value on an EnumItem named "group", which is both the unique identifier and group name. In the case no such "extra" value exists, the EnumItem is not grouped.
The idea for objects is: An Enum subclass is defined (ObjectEnum, maybe) that will perform the auto-value- from-object- id function on the "value" parameter of EnumItems.
The win here is that we can squash the problem of having to expand every combination of grouped ChoiceInputs and object ChoiceInputs. Unfortunately defining an Enum is not as simple as dumping a tuples and a lists in your source code, on the other hand it is a lot more descriptive and useful. There is an adapter for list to IEnumeration, so the old style would still work, it just wouldn't be very flexible.