Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign updependant list added. #319
Conversation
… user choice, depends on choosen values of othe parameters. The relations shoud be set in configuration manually. Parameter configuration window in admin has not been changed.
|
A far as i have seen CI test failed due to f-string syntax (PEP 498). |
|
There are a couple of minor comments (mostly styling or wording). Great job! |
| @@ -1,4 +1,6 @@ | |||
| PARAM_TYPE_SERVER_FILE = 'server_file' | |||
| PARAM_TYPE_MULTISELECT = 'multiselect' | |||
| PARAM_TYPE_LIST = 'list' | |||
| PARAM_TYPE_DEPENDANT_LIST = 'dependant_list' | |||
bugy
Jul 5, 2020
Owner
I think this is not exactly "param type" because the type is still "list" (according to the example, you added)
I think this is not exactly "param type" because the type is still "list" (according to the example, you added)
jtprof
Jul 6, 2020
Author
Contributor
Formally you are right. But
- Other types (such 'text', 'int', etc.) don't have its own constants, so the file needs to refactor
- I believe the issue should been separated to its own type, so, it's for future use
Formally you are right. But
- Other types (such 'text', 'int', etc.) don't have its own constants, so the file needs to refactor
- I believe the issue should been separated to its own type, so, it's for future use
bugy
Jul 8, 2020
Owner
Can we call it "list subtype" or smth like this? :)
I raised this concern only because I was confused while reading the code
Can we call it "list subtype" or smth like this? :)
I raised this concern only because I was confused while reading the code
| "name": "Dependant List", | ||
| "param": "--dependant_list", | ||
| "type": "list", | ||
| "description": "The avalible values depends on other variables", |
bugy
Jul 5, 2020
Owner
Could you fix typos please? :) "Available" "depend"
Could you fix typos please? :) "Available" "depend"
| for key in self._values_conditions[e]: | ||
| pvalue = parameter_values.get(key) | ||
| if not is_empty(pvalue): | ||
| if not(pvalue in self._values_conditions[e][key] ): |
bugy
Jul 5, 2020
Owner
could you change it to not in, please?
could you change it to not in, please?
| self._availible_values = set() | ||
| deny_values = set() | ||
|
|
||
| for e in self._values_conditions: |
bugy
Jul 5, 2020
Owner
Could you rename e to something like possible_value, otherwise it's pretty hard to read
Could you rename e to something like possible_value, otherwise it's pretty hard to read
| @@ -52,6 +52,46 @@ def __init__(self, script) -> None: | |||
| def get_values(self, parameter_values): | |||
| return self._values | |||
|
|
|||
| class DependantValuesProvider(ValuesProvider): | |||
bugy
Jul 5, 2020
Owner
Would you mind adding a couple of tests for this class? Specifically for get_values method
Would you mind adding a couple of tests for this class? Specifically for get_values method
|
Hi @jtprof Thanks a lot for the PR! and really sorry for the late response, it was quite busy week for me. Regarding python 3.6: I would love to use f-strings also, but I think there are still some people using python 3.5, so I would prefer to keep 3.5 compability for now, especially considering that 3.5 is still "active" python version https://devguide.python.org/#status-of-python-branches |
2020-09-13 'End-of-life'. It's so close. |
…'ipv6', 'int' types variable have been added as composed by script.
| venv/ | ||
|
|
||
| conf/rediska.conf |
bugy
Jul 8, 2020
Owner
I think those are not needed
I think those are not needed
| @@ -1,4 +1,6 @@ | |||
| PARAM_TYPE_SERVER_FILE = 'server_file' | |||
| PARAM_TYPE_MULTISELECT = 'multiselect' | |||
| PARAM_TYPE_LIST = 'list' | |||
| PARAM_TYPE_DEPENDANT_LIST = 'dependant_list' | |||
bugy
Jul 8, 2020
Owner
Can we call it "list subtype" or smth like this? :)
I raised this concern only because I was confused while reading the code
Can we call it "list subtype" or smth like this? :)
I raised this concern only because I was confused while reading the code
Enable searchbox support on multiselect combobox
|
HI @jtprof, sorry for being inactive here. I started working on refactoring for this PR and thought how to make configuration of conditional values a bit simpler (at the moment it has multiple nested levels) and more generic (so that you can use patterns, comparison, etc.). |
The values in the list, which are available to a user choice, depends on chosen values of other parameters.
The relations should be set in configuration manually.
Parameter configuration window in admin has not been changed.
The feature useful to avoid user to set inadmissible values combination.
Example in parameterized.json:
'aduld dogs food' in "Dependant List" variable is unavailable while "Cats", "Rats" or "Squirrel" is chosen in "Simple List" variable.